This document includes code for the process of model selection and diagnostics tests for each response variable. Code for the final models and post hoc tests are also included in the XofsteringCh2.R.

PROJECT OVERVIEW

Read in the necessary files: XfosteringUnitSummary_Sheet1.csv (aka ‘summary’ below),frates_wide2.csv, firezals_sum.csv, stimframe.csv, StimulusDurationsCh2.csv (aka ‘stimIDs’ below),dprime.csv ,dprime_species.csv ,dprime_wn.csv, fullsummary_CDFG.csv (aka ‘clutchcdfg’ below)

Manipulate files

#read in frates_wide2, summary, stimframe, stimframe, and stimIDs dfs

##SUMMARY METADATA##
summary<-summary[,-c(23:30)] #remove last 8 columns, which are all blank (not sure why R adds these...)


##FILL IN UNIT TYPE COLUMN## 
#if only broad, NS1, and NS2 (for stats)
firezals_sum$Type0<-with(firezals_sum, ifelse(Region == "NCM" & Peak.to.Peak_s > 0.0004, "Broad",
                ifelse(Region == "NCM" & Peak.to.Peak_s < 0.0004 & Peak2PeakRatio < 0.355, "NS1",
            ifelse(Region == "NCM" & Peak.to.Peak_s < 0.0004 & Peak2PeakRatio > 0.355, "NS2","Field L"))))
firezals_sum$TypeBN<-with(firezals_sum, ifelse(Region == "NCM" & Peak.to.Peak_s > 0.0004, "Broad",
               ifelse(Region == "NCM" & Peak.to.Peak_s < 0.0004, "Narrow","Field L")))
#Field L unit types
firezals_sum$TypeFL<-with(firezals_sum,ifelse(Region == "FL" & Peak.to.Peak_s > 0.0004, "Broad",
                                              ifelse(Region == "FL" & Peak.to.Peak_s < 0.0004,"Narrow","NCM")))

#Combine FamUnfam and Species columns
firezals_sum<-unite(firezals_sum,FamUnfamSpecies,FamUnfam,Species, sep = "_",remove=FALSE)
#remove BEFI units
firezals_sum_zebi<-subset(firezals_sum,Treatment!="BEFI")
#remove FosterFather stimulus
firezals_sum_zebi<-subset(firezals_sum_zebi,FamUnfam!="FosterFather")
#Make "normal" treatment the reference level
firezals_sum_zebi$Treatment<-relevel(as.factor(firezals_sum_zebi$Treatment),ref=2)
#Make "Field L" the reference level unit type
firezals_sum_zebi$Type0<-relevel(as.factor(firezals_sum_zebi$Type0),ref=2)
#Make "ZEBI" the reference level species
firezals_sum_zebi$Species<-relevel(as.factor(firezals_sum_zebi$Species),ref=3)
#Separate data frames for Field L and NCM
firezals_sum_zebiNCM<-subset(firezals_sum_zebi,Region=="NCM")
firezals_sum_zebiFL<-subset(firezals_sum_zebi,Region=="FL")

BASELINE FIRING RATE

We will model firing rate like count data. The model will be based on all repeated measures of the same unit before each individual presentation of all stimuli (i.e. 5 stimuli x ~15 presentations per unit, but varies across units).

Manipulate the data frame

#use frates_wide2, summary, stimframe, and stimIDs dfs
#combine all dfs to include treatment,stimID, and waveform info
frates_wide3<-merge(frates_wide2,summary,by.x=c("ID","Region","Trialx","Letter"),by.y=c("ID","Region","Trial","Letter"),all.x = TRUE)
stimframe$Trialx<-gsub("[a-zA-Z]","",stimframe$Trial)
frates_wide4<-merge(frates_wide3,stimframe,by=c("ID","Region","Trialx"),all.x = TRUE)
frates_wide4$Stimulus<-gsub("[?]","",frates_wide4$Stimulus)
frates_wide5<-merge(frates_wide4,stimIDs,by.x=c("StimSet","Stimulus"),by.y=c("StimSet","StimNumber"),all.x = TRUE)
#fill in unit type 
frates_wide5$Peak2PeakRatio<-abs(as.numeric(frates_wide5$Trough_V)/frates_wide5$Peak_V)
frates_wide5$Peak.to.Peak_s<-as.numeric(frates_wide5$Peak.to.Peak_s)
frates_wide5$Type0<-with(frates_wide5, 
                      ifelse(Region == "NCM" & Peak.to.Peak_s > 0.0004, "Broad",
                      ifelse(Region == "NCM" & Peak.to.Peak_s < 0.0004 & Peak2PeakRatio < 0.355, "NS1",
                      ifelse(Region == "NCM" & Peak.to.Peak_s < 0.0004 & Peak2PeakRatio > 0.355, "NS2","Field L"))))
frates_wide5$TypeFL<-with(frates_wide5,ifelse(Region == "FL" & Peak.to.Peak_s > 0.0004, "Broad",
                                              ifelse(Region == "FL" & Peak.to.Peak_s < 0.0004,"Narrow","NCM")))
#remove BEFI units
frates_wide5<-subset(frates_wide5,Treatment.y!="BEFI")
#remove FosterFather stimulus
frates_wide5<-subset(frates_wide5,FamUnfam!="FosterFather")
#Make "normal" treatment the reference level
frates_wide5$Treatment.y<-relevel(as.factor(frates_wide5$Treatment.y),ref=2)
#Make "Field L" the reference level unit type
frates_wide5$Type0<-relevel(as.factor(frates_wide5$Type0),ref=2)
#Separate brain regions
frates_wide5_FL<-subset(frates_wide5,Region=="FL")
frates_wide5_NCM<-subset(frates_wide5,Region=="NCM")

Distributions to test: poisson, negative bionomial 1, negative binomial 2

Possible predictor variables: Treatment, Type0, Mass, Hemisphere

Field L

Create models to test distributions and inclusion of predictors:

basep1<-glmmTMB(base_fr~Treatment.y+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x),data=frates_wide5_FL,family="poisson")
basenb11<-glmmTMB(base_fr~Treatment.y+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x),data=frates_wide5_FL,family="nbinom1") #does not converge
basenb21<-glmmTMB(base_fr~Treatment.y+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x),data=frates_wide5_FL,family="nbinom2")
AICtab(basep1,basenb11,basenb21) #NB2 model is best fit

basenb21x<-glmmTMB(base_fr~Treatment.y+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere),data=frates_wide5_FL,family="nbinom2")
basenb21y<-glmmTMB(base_fr~Treatment.y+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere),data=frates_wide5_FL,family="nbinom2")
basenb21a<-glmmTMB(base_fr~Treatment.y+TypeFL+Mass+(1|Unit2)+(1|Hemisphere),data=frates_wide5_FL,family="nbinom2")
basenb21b<-glmmTMB(base_fr~Treatment.y+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),data=frates_wide5_FL,family="nbinom2")
basenb21c<-glmmTMB(base_fr~Treatment.y+TypeFL+Mass+Hemisphere+(1|Unit2),data=frates_wide5_FL,family="nbinom2")
AICtab(basenb21a,basenb21b,basenb21c,basenb21,basenb21x,basenb21y) #basenb21c is best fit

Random effects removed (because variance very low i.e. < 0.001): Clutch, DaysPostFledge, ID.x, Age

basenb21c is best fit by > 2 AIC

Model diagnostics

FLbasenb11c<-glmmTMB(base_fr~Treatment.y+TypeFL+Mass+Hemisphere+(1|Unit2),data=frates_wide5_FL,family="nbinom2")

simres <- simulateResiduals(FLbasenb11c)
plot(simres) #KS test deviation significant (but likely due to Type I error because of large sample size), others are fine.

#plotResiduals(simres, form = frates_wide5$Hemisphere)
#plotResiduals(simres, form = frates_wide5$Treatment.y)
#plotResiduals(simres, form = frates_wide5$Type0)
testDispersion(simres) #no overdispersion or underdispersion

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 0.85024, p-value = 0.456
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = 1.0971, p-value = 0.128
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') #outliers ARE significant

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 29, observations = 11506, p-value = 0.08
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.002250999 0.009212585
## sample estimates:
## outlier frequency (expected: 0.00525464974795759 ) 
##                                        0.002520424

After bootstrapping there are too many outliers, but this is barely the case and there is no experimental reason to remove them. The KS test is significant, but this is likely to be Type I error because there are ~10000 data points. Move forward with basenb11c model.

Final model inference, means, and post hoc tests

summary(FLbasenb11c)
##  Family: nbinom2  ( log )
## Formula:          
## base_fr ~ Treatment.y + TypeFL + Mass + Hemisphere + (1 | Unit2)
## Data: frates_wide5_FL
## 
##      AIC      BIC   logLik deviance df.resid 
##  46614.1  46672.9 -23299.0  46598.1    11498 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.34     0.5831  
## Number of obs: 11506, groups:  Unit2, 178
## 
## Dispersion parameter for nbinom2 family (): 6.05 
## 
## Conditional model:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          -0.91485    0.41316  -2.214 0.026809 *  
## Treatment.yIsolate    0.66406    0.12993   5.111 3.20e-07 ***
## Treatment.yxfostered  0.81823    0.11322   7.227 4.95e-13 ***
## TypeFLNarrow          0.14193    0.09600   1.478 0.139320    
## Mass                  0.12302    0.03366   3.655 0.000257 ***
## HemisphereR          -0.26480    0.09508  -2.785 0.005351 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(0.1230) #effect of mass
## [1] 1.130884
exp(-0.2648) #effect of hemisphere
## [1] 0.7673594
emmeans(FLbasenb11c,pairwise~Treatment.y)
## $emmeans
##  Treatment.y emmean     SE  df asymp.LCL asymp.UCL
##  normal        0.48 0.0787 Inf     0.326     0.634
##  Isolate       1.14 0.0991 Inf     0.950     1.338
##  xfostered     1.30 0.0737 Inf     1.154     1.443
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      -0.664 0.130 Inf  -5.111  <.0001
##  normal - xfostered    -0.818 0.113 Inf  -7.227  <.0001
##  Isolate - xfostered   -0.154 0.119 Inf  -1.298  0.3965
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(FLbasenb11c,pairwise~Treatment.y,type="response")
## $emmeans
##  Treatment.y response    SE  df asymp.LCL asymp.UCL
##  normal          1.62 0.127 Inf      1.39      1.89
##  Isolate         3.14 0.311 Inf      2.59      3.81
##  xfostered       3.66 0.270 Inf      3.17      4.23
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast            ratio     SE  df null z.ratio p.value
##  normal / Isolate    0.515 0.0669 Inf    1  -5.111  <.0001
##  normal / xfostered  0.441 0.0500 Inf    1  -7.227  <.0001
##  Isolate / xfostered 0.857 0.1018 Inf    1  -1.298  0.3965
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale

NCM

Create models to test distributions and inclusion of predictors:

basep1<-glmmTMB(base_fr~Treatment.y+Type0+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x),data=frates_wide5_NCM,family="poisson")
basenb11<-glmmTMB(base_fr~Treatment.y+Type0+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x),data=frates_wide5_NCM,family="nbinom1")
basenb21<-glmmTMB(base_fr~Treatment.y+Type0(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x),data=frates_wide5_NCM,family="nbinom2")
AICtab(basep1,basenb11,basenb21) #NB1 model is best fit

basenb11x<-glmmTMB(base_fr~Treatment.y+Type0+(1|Unit2)+(1|Age)+(1|Mass)+(1|Hemisphere),data=frates_wide5_NCM,family="nbinom1")
basenb11y<-glmmTMB(base_fr~Treatment.y+Type0+(1|Unit2)+(1|Age)+(1|Mass)+(1|Hemisphere),data=frates_wide5_NCM,family="nbinom1")
basenb11a<-glmmTMB(base_fr~Treatment.y+Type0+Mass+(1|Unit2)+(1|Age)+(1|Hemisphere),data=frates_wide5_NCM,family="nbinom1")
basenb11b<-glmmTMB(base_fr~Treatment.y+Type0+Hemisphere+(1|Unit2)+(1|Age)+(1|Mass),data=frates_wide5_NCM,family="nbinom1")
basenb11c<-glmmTMB(base_fr~Treatment.y+Type0+Mass+Hemisphere+(1|Unit2)+(1|Age),data=frates_wide5_NCM,family="nbinom1")
AICtab(basenb11a,basenb11b,basenb11c,basenb11,basenb11x,basenb11y) #basenb11c is best fit

Random effects removed (because variance very low i.e. < 0.001): Clutch, DaysPostFledge, ID.x

basenb11b and basenb11c are not >2AIC apart. basenb11b is better with diagnostics and AIC.

Model diagnostics

NCMbasenb11b<-glmmTMB(base_fr~Treatment.y+Type0+Hemisphere+(1|Unit2)+(1|Age)+(1|Mass),data=frates_wide5_NCM,family="nbinom1")
simres <- simulateResiduals(NCMbasenb11b)
plot(simres) #KS test deviation significant (but likely due to Type I error because of large sample size), others are fine.
## DHARMa:testOutliers with type = binomial may have inflated Type I error rates for integer-valued distributions. To get a more exact result, it is recommended to re-run testOutliers with type = 'bootstrap'. See ?testOutliers for details

#plotResiduals(simres, form = frates_wide5$Hemisphere)
#plotResiduals(simres, form = frates_wide5$Treatment.y)
#plotResiduals(simres, form = frates_wide5$Type0)
testDispersion(simres) #no overdispersion or underdispersion

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 1.3162, p-value = 0.208
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = 0.84076, p-value = 0.272
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') #outliers not significant

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 57, observations = 9781, p-value = 0.62
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.001173193 0.012084654
## sample estimates:
## outlier frequency (expected: 0.00498926490133933 ) 
##                                        0.005827625

After bootstrapping there are no longer too many outliers. The KS test is significant, but this is likely to be Type I error because there are ~10000 data points. Move forward with basenb11c model.

Final model inference, means, and post hoc tests

summary(NCMbasenb11b)
##  Family: nbinom1  ( log )
## Formula:          
## base_fr ~ Treatment.y + Type0 + Hemisphere + (1 | Unit2) + (1 |  
##     Age) + (1 | Mass)
## Data: frates_wide5_NCM
## 
##      AIC      BIC   logLik deviance df.resid 
##  38696.1  38768.0 -19338.1  38676.1     9771 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.26187  0.5117  
##  Age    (Intercept) 0.04547  0.2132  
##  Mass   (Intercept) 0.02003  0.1415  
## Number of obs: 9781, groups:  Unit2, 150; Age, 6; Mass, 12
## 
## Dispersion parameter for nbinom1 family (): 0.845 
## 
## Conditional model:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           0.54056    0.14701   3.677 0.000236 ***
## Treatment.yIsolate    0.70798    0.15769   4.490 7.13e-06 ***
## Treatment.yxfostered  0.35149    0.13952   2.519 0.011763 *  
## Type0NS1              0.31690    0.13238   2.394 0.016668 *  
## Type0NS2              0.49238    0.12712   3.874 0.000107 ***
## HemisphereR          -0.25119    0.09993  -2.514 0.011950 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(-0.25119) #effect of hemisphere
## [1] 0.7778746
emmeans(NCMbasenb11b,pairwise~Treatment.y)
## $emmeans
##  Treatment.y emmean    SE  df asymp.LCL asymp.UCL
##  normal       0.685 0.144 Inf     0.403     0.966
##  Isolate      1.393 0.184 Inf     1.031     1.754
##  xfostered    1.036 0.137 Inf     0.768     1.304
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      -0.708 0.158 Inf  -4.490  <.0001
##  normal - xfostered    -0.351 0.140 Inf  -2.519  0.0316
##  Isolate - xfostered    0.356 0.179 Inf   1.995  0.1133
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(NCMbasenb11b,pairwise~Treatment.y,type="response")
## $emmeans
##  Treatment.y response    SE  df asymp.LCL asymp.UCL
##  normal          1.98 0.285 Inf      1.50      2.63
##  Isolate         4.03 0.743 Inf      2.80      5.78
##  xfostered       2.82 0.386 Inf      2.16      3.69
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast            ratio     SE  df null z.ratio p.value
##  normal / Isolate    0.493 0.0777 Inf    1  -4.490  <.0001
##  normal / xfostered  0.704 0.0982 Inf    1  -2.519  0.0316
##  Isolate / xfostered 1.428 0.2552 Inf    1   1.995  0.1133
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale
emmeans(NCMbasenb11b,pairwise~Type0)
## $emmeans
##  Type0 emmean    SE  df asymp.LCL asymp.UCL
##  Broad  0.768 0.120 Inf     0.533      1.00
##  NS1    1.085 0.166 Inf     0.760      1.41
##  NS2    1.261 0.164 Inf     0.939      1.58
## 
## Results are averaged over the levels of: Treatment.y, Hemisphere 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate    SE  df z.ratio p.value
##  Broad - NS1   -0.317 0.132 Inf  -2.394  0.0440
##  Broad - NS2   -0.492 0.127 Inf  -3.874  0.0003
##  NS1 - NS2     -0.175 0.170 Inf  -1.031  0.5575
## 
## Results are averaged over the levels of: Treatment.y, Hemisphere 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(NCMbasenb11b,pairwise~Type0,type="response")
## $emmeans
##  Type0 response    SE  df asymp.LCL asymp.UCL
##  Broad     2.16 0.259 Inf      1.70      2.73
##  NS1       2.96 0.490 Inf      2.14      4.09
##  NS2       3.53 0.579 Inf      2.56      4.87
## 
## Results are averaged over the levels of: Treatment.y, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast    ratio     SE  df null z.ratio p.value
##  Broad / NS1 0.728 0.0964 Inf    1  -2.394  0.0440
##  Broad / NS2 0.611 0.0777 Inf    1  -3.874  0.0003
##  NS1 / NS2   0.839 0.1429 Inf    1  -1.031  0.5575
## 
## Results are averaged over the levels of: Treatment.y, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale

STIMULUS-EVOKED FIRING RATE

We will model these data like counts and use an offset term in the models to account for differences in duration of each stimulus.

#use frates_wide5 df
#stim_fr column is currently spikes/sec (i.e. a rate)
#Back-calculate the raw count by multiplying by the duration of each stimulus
frates_wide5$stim_fr_count<-frates_wide5$stim_fr*frates_wide5$Duration.s
#Combine Species and FamUnfam columns?
frates_wide5<-unite(frates_wide5,FamUnfamSpecies,FamUnfam,Species, sep = "_",remove=FALSE)
#Separate brain regions
frates_wide5_FL<-subset(frates_wide5,Region=="FL")
frates_wide5_NCM<-subset(frates_wide5,Region=="NCM")

Field L

Testing for the best distribution:

#stimp<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_FL,family="poisson") #does not converge
stimnb1<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")
#stimnb2<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom2") #does not converge
#AICtab(stimnb1,stimnb2) 

Best distribution = negative binomial 1

Random effects removed due to low variance (i.e. < 0.001): Age, Clutch, ID.x, Hemisphere, Mass (on the edge, but made no difference)

Testing addition of other predictors and zero inflation term

stimnb10<-glmmTMB(stim_fr_count~Treatment.y+FamUnfamSpecies+TypeFL+(1|Unit2)+(1|DaysPostFledge)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")
stimnb11<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|DaysPostFledge)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")
stimnb13<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+DaysPostFledge+(1|Unit2)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")
stimnb14<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")
#stimnb130<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+DaysPostFledge+(1|Unit2)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")
AICtab(stimnb1,stimnb10,stimnb11,stimnb13,stimnb14) 

Best model fit is stimnb13 (next model deltaAIC = 5.5)

Model diagnostics

FLstimnb13<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+TypeFL+DaysPostFledge+(1|Unit2)+offset(log(Duration.s)),data=frates_wide5_FL,family="nbinom1")

#diagnostics check (Dharma package)
simres <- simulateResiduals(FLstimnb13)
plot(simres) #KS test significant

#plotResiduals(simres, form = frates_wide5$Treatment.y)
testDispersion(simres) #no overdispersion or underdispersion

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 0.90455, p-value = 0.744
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = 0.96431, p-value = 0.912
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') # number of outliers not significant

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 70, observations = 11506, p-value = 0.46
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.003476447 0.013910134
## sample estimates:
## outlier frequency (expected: 0.00810707456978967 ) 
##                                        0.006083782

KS test significant, but no other test show an issue after using bootstrapping to get a more exact result. Uniformity is likely off because of Type I error and this large number of samples, so I will move forward with the stimnb13 model.

Note: If a model is fitted and its formula includes an offset() term, then by default, the offset is computed and included in the reference grid for calculation of emmeans.

Model inference, means, and post hoc tests

summary(FLstimnb13)
##  Family: nbinom1  ( log )
## Formula:          
## stim_fr_count ~ Treatment.y * FamUnfamSpecies + TypeFL + DaysPostFledge +  
##     (1 | Unit2) + offset(log(Duration.s))
## Data: frates_wide5_FL
## 
##      AIC      BIC   logLik deviance df.resid 
##  67346.2  67463.8 -33657.1  67314.2    11490 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.2557   0.5057  
## Number of obs: 11506, groups:  Unit2, 178
## 
## Dispersion parameter for nbinom1 family (): 1.04 
## 
## Conditional model:
##                                                      Estimate Std. Error
## (Intercept)                                          1.267195   0.110190
## Treatment.yIsolate                                   0.081800   0.111744
## Treatment.yxfostered                                 0.206663   0.096956
## FamUnfamSpeciesUnfamiliar_BEFI                      -0.222692   0.018327
## FamUnfamSpeciesUnfamiliar_ZEBI                      -0.008061   0.021221
## FamUnfamSpeciesWN_WN                                -0.581307   0.024318
## TypeFLNarrow                                         0.451663   0.082715
## DaysPostFledge                                       0.150043   0.037954
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.204407   0.027642
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.166097   0.028866
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.145060   0.031748
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.104218   0.030892
## Treatment.yIsolate:FamUnfamSpeciesWN_WN              0.135789   0.036092
## Treatment.yxfostered:FamUnfamSpeciesWN_WN            0.041643   0.033810
##                                                     z value Pr(>|z|)    
## (Intercept)                                          11.500  < 2e-16 ***
## Treatment.yIsolate                                    0.732 0.464153    
## Treatment.yxfostered                                  2.132 0.033046 *  
## FamUnfamSpeciesUnfamiliar_BEFI                      -12.151  < 2e-16 ***
## FamUnfamSpeciesUnfamiliar_ZEBI                       -0.380 0.704038    
## FamUnfamSpeciesWN_WN                                -23.904  < 2e-16 ***
## TypeFLNarrow                                          5.460 4.75e-08 ***
## DaysPostFledge                                        3.953 7.71e-05 ***
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_BEFI     7.395 1.42e-13 ***
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_BEFI   5.754 8.71e-09 ***
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_ZEBI     4.569 4.90e-06 ***
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  -3.374 0.000742 ***
## Treatment.yIsolate:FamUnfamSpeciesWN_WN               3.762 0.000168 ***
## Treatment.yxfostered:FamUnfamSpeciesWN_WN             1.232 0.218064    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp( 0.15004) #effect of days post fledge
## [1] 1.161881
exp(0.45166) #effect of unit type
## [1] 1.570918
emmeans(FLstimnb13,pairwise~"FamUnfamSpecies","Treatment.y")
## $emmeans
## Treatment.y = normal:
##  FamUnfamSpecies emmean     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       2.39 0.0680 Inf      2.26      2.53
##  Unfamiliar_BEFI   2.17 0.0674 Inf      2.04      2.30
##  Unfamiliar_ZEBI   2.38 0.0683 Inf      2.25      2.52
##  WN_WN             1.81 0.0693 Inf      1.67      1.95
## 
## Treatment.y = Isolate:
##  FamUnfamSpecies emmean     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       2.47 0.0880 Inf      2.30      2.65
##  Unfamiliar_BEFI   2.46 0.0872 Inf      2.28      2.63
##  Unfamiliar_ZEBI   2.61 0.0879 Inf      2.44      2.78
##  WN_WN             2.03 0.0888 Inf      1.85      2.20
## 
## Treatment.y = xfostered:
##  FamUnfamSpecies emmean     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       2.60 0.0642 Inf      2.47      2.72
##  Unfamiliar_BEFI   2.54 0.0621 Inf      2.42      2.66
##  Unfamiliar_ZEBI   2.49 0.0620 Inf      2.36      2.61
##  WN_WN             2.06 0.0627 Inf      1.94      2.18
## 
## Results are averaged over the levels of: TypeFL 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment.y = normal:
##  contrast                          estimate     SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.22269 0.0183 Inf  12.151  <.0001
##  Father_ZEBI - Unfamiliar_ZEBI      0.00806 0.0212 Inf   0.380  0.9813
##  Father_ZEBI - WN_WN                0.58131 0.0243 Inf  23.904  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.21463 0.0192 Inf -11.181  <.0001
##  Unfamiliar_BEFI - WN_WN            0.35862 0.0225 Inf  15.955  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.57325 0.0249 Inf  23.003  <.0001
## 
## Treatment.y = Isolate:
##  contrast                          estimate     SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.01828 0.0207 Inf   0.884  0.8134
##  Father_ZEBI - Unfamiliar_ZEBI     -0.13700 0.0236 Inf  -5.802  <.0001
##  Father_ZEBI - WN_WN                0.44552 0.0267 Inf  16.705  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.15528 0.0201 Inf  -7.711  <.0001
##  Unfamiliar_BEFI - WN_WN            0.42723 0.0237 Inf  18.063  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.58252 0.0262 Inf  22.209  <.0001
## 
## Treatment.y = xfostered:
##  contrast                          estimate     SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.05659 0.0223 Inf   2.538  0.0543
##  Father_ZEBI - Unfamiliar_ZEBI      0.11228 0.0224 Inf   5.001  <.0001
##  Father_ZEBI - WN_WN                0.53966 0.0235 Inf  22.977  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.05569 0.0126 Inf   4.408  0.0001
##  Unfamiliar_BEFI - WN_WN            0.48307 0.0159 Inf  30.292  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.42738 0.0150 Inf  28.475  <.0001
## 
## Results are averaged over the levels of: TypeFL 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(FLstimnb13,pairwise~"FamUnfamSpecies","Treatment.y",type="response")
## $emmeans
## Treatment.y = normal:
##  FamUnfamSpecies response    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI        10.93 0.744 Inf      9.57     12.49
##  Unfamiliar_BEFI     8.75 0.590 Inf      7.67      9.99
##  Unfamiliar_ZEBI    10.84 0.740 Inf      9.49     12.40
##  WN_WN               6.11 0.424 Inf      5.34      7.00
## 
## Treatment.y = Isolate:
##  FamUnfamSpecies response    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI        11.86 1.044 Inf      9.98     14.10
##  Unfamiliar_BEFI    11.65 1.015 Inf      9.82     13.82
##  Unfamiliar_ZEBI    13.61 1.196 Inf     11.45     16.16
##  WN_WN               7.60 0.675 Inf      6.39      9.04
## 
## Treatment.y = xfostered:
##  FamUnfamSpecies response    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI        13.44 0.863 Inf     11.85     15.24
##  Unfamiliar_BEFI    12.70 0.789 Inf     11.25     14.35
##  Unfamiliar_ZEBI    12.01 0.745 Inf     10.64     13.57
##  WN_WN               7.84 0.491 Inf      6.93      8.86
## 
## Results are averaged over the levels of: TypeFL 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
## Treatment.y = normal:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.249 0.0229 Inf    1  12.151  <.0001
##  Father_ZEBI / Unfamiliar_ZEBI     1.008 0.0214 Inf    1   0.380  0.9813
##  Father_ZEBI / WN_WN               1.788 0.0435 Inf    1  23.904  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.807 0.0155 Inf    1 -11.181  <.0001
##  Unfamiliar_BEFI / WN_WN           1.431 0.0322 Inf    1  15.955  <.0001
##  Unfamiliar_ZEBI / WN_WN           1.774 0.0442 Inf    1  23.003  <.0001
## 
## Treatment.y = Isolate:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.018 0.0211 Inf    1   0.884  0.8134
##  Father_ZEBI / Unfamiliar_ZEBI     0.872 0.0206 Inf    1  -5.802  <.0001
##  Father_ZEBI / WN_WN               1.561 0.0416 Inf    1  16.705  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.856 0.0172 Inf    1  -7.711  <.0001
##  Unfamiliar_BEFI / WN_WN           1.533 0.0363 Inf    1  18.063  <.0001
##  Unfamiliar_ZEBI / WN_WN           1.791 0.0470 Inf    1  22.209  <.0001
## 
## Treatment.y = xfostered:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.058 0.0236 Inf    1   2.538  0.0543
##  Father_ZEBI / Unfamiliar_ZEBI     1.119 0.0251 Inf    1   5.001  <.0001
##  Father_ZEBI / WN_WN               1.715 0.0403 Inf    1  22.977  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 1.057 0.0134 Inf    1   4.408  0.0001
##  Unfamiliar_BEFI / WN_WN           1.621 0.0259 Inf    1  30.292  <.0001
##  Unfamiliar_ZEBI / WN_WN           1.533 0.0230 Inf    1  28.475  <.0001
## 
## Results are averaged over the levels of: TypeFL 
## P value adjustment: tukey method for comparing a family of 4 estimates 
## Tests are performed on the log scale
emmeans(FLstimnb13,pairwise~Treatment.y)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment.y emmean     SE  df asymp.LCL asymp.UCL
##  normal        2.19 0.0669 Inf      2.06      2.32
##  Isolate       2.39 0.0868 Inf      2.22      2.56
##  xfostered     2.42 0.0617 Inf      2.30      2.54
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate     SE  df z.ratio p.value
##  normal - Isolate     -0.2031 0.1101 Inf  -1.845  0.1551
##  normal - xfostered   -0.2325 0.0946 Inf  -2.458  0.0372
##  Isolate - xfostered  -0.0294 0.1078 Inf  -0.273  0.9598
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(FLstimnb13,pairwise~Treatment.y,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment.y response    SE  df asymp.LCL asymp.UCL
##  normal          8.92 0.597 Inf      7.83      10.2
##  Isolate        10.93 0.949 Inf      9.22      13.0
##  xfostered      11.26 0.694 Inf      9.98      12.7
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast            ratio     SE  df null z.ratio p.value
##  normal / Isolate    0.816 0.0899 Inf    1  -1.845  0.1551
##  normal / xfostered  0.793 0.0750 Inf    1  -2.458  0.0372
##  Isolate / xfostered 0.971 0.1047 Inf    1  -0.273  0.9598
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale

NCM

Testing for the best distribution:

stimp<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="poisson")
#stimnb1<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1") #does not converge
stimnb1a<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1") 
stimnb2<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|DaysPostFledge)+(1|Age)+(1|Clutch)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom2") 
AICtab(stimp,stimnb1a,stimnb2) 

Best distribution = negative binomial 1 (but only after removing unnecessary random effects)

Random effects removed due to low variance (i.e. < 0.001): Age, DaysPostFledge, Hemisphere, Clutch, probably also Mass

Testing addition of other predictors and zero inflation term

stimnb10<-glmmTMB(stim_fr_count~Treatment.y+FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")
stimnb11<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")
stimnb12<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+Mass+(1|Unit2)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")
stimnb13<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+DaysPostFledge+(1|Unit2)+(1|Mass)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")
stimnb14<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|Mass)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")
stimnb15<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")
AICtab(stimnb1,stimnb10,stimnb11,stimnb12,stimnb13,stimnb14,stimnb15) 

stimnb15 and stimnb12 are within 2 deltaAIC, but 15 is slightly lower and has less df, so I will go with that model.

Model diagnostics

NCMstimnb15<-glmmTMB(stim_fr_count~Treatment.y*FamUnfamSpecies+Type0+(1|Unit2)+(1|ID.x)+offset(log(Duration.s)),data=frates_wide5_NCM,family="nbinom1")

#diagnostics check (Dharma package)
simres <- simulateResiduals(NCMstimnb15)
plot(simres) #KS test significant
## DHARMa:testOutliers with type = binomial may have inflated Type I error rates for integer-valued distributions. To get a more exact result, it is recommended to re-run testOutliers with type = 'bootstrap'. See ?testOutliers for details

#plotResiduals(simres, form = frates_wide5$Treatment.y)
testDispersion(simres) #no overdispersion or underdispersion

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 1.2102, p-value = 0.304
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = 0.81559, p-value = 0.376
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') # number of outliers not significant

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 114, observations = 9781, p-value = 0.26
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.002701666 0.015900726
## sample estimates:
## outlier frequency (expected: 0.00693998568653512 ) 
##                                         0.01165525

KS test significant, but no other test show an issue after using bootstrapping to get a more exact result. Uniformity is likely off because of Type I error and this large number of samples, so I will move forward with the stimnb15 model.

Note: If a model is fitted and its formula includes an offset() term, then by default, the offset is computed and included in the reference grid for calculation of emmeans.

Model inference, means, and post hoc tests

summary(NCMstimnb15)
##  Family: nbinom1  ( log )
## Formula:          stim_fr_count ~ Treatment.y * FamUnfamSpecies + Type0 + (1 |  
##     Unit2) + (1 | ID.x) + offset(log(Duration.s))
## Data: frates_wide5_NCM
## 
##      AIC      BIC   logLik deviance df.resid 
##  54305.9  54428.1 -27135.9  54271.9     9764 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.19234  0.4386  
##  ID.x   (Intercept) 0.05164  0.2272  
## Number of obs: 9781, groups:  Unit2, 150; ID.x, 16
## 
## Dispersion parameter for nbinom1 family ():  1.2 
## 
## Conditional model:
##                                                     Estimate Std. Error z value
## (Intercept)                                          1.47624    0.11522   12.81
## Treatment.yIsolate                                   0.38463    0.20614    1.87
## Treatment.yxfostered                                 0.11680    0.16000    0.73
## FamUnfamSpeciesUnfamiliar_BEFI                      -0.01801    0.01913   -0.94
## FamUnfamSpeciesUnfamiliar_ZEBI                       0.07829    0.02247    3.48
## FamUnfamSpeciesWN_WN                                -0.93061    0.02894  -32.15
## Type0NS1                                             0.36042    0.11207    3.22
## Type0NS2                                             0.41376    0.10850    3.81
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_BEFI   -0.07285    0.03665   -1.99
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.14879    0.03636    4.09
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   -0.01633    0.04221   -0.39
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.20625    0.03902   -5.29
## Treatment.yIsolate:FamUnfamSpeciesWN_WN              0.61162    0.04825   12.68
## Treatment.yxfostered:FamUnfamSpeciesWN_WN            0.25509    0.04490    5.68
##                                                     Pr(>|z|)    
## (Intercept)                                          < 2e-16 ***
## Treatment.yIsolate                                  0.062057 .  
## Treatment.yxfostered                                0.465379    
## FamUnfamSpeciesUnfamiliar_BEFI                      0.346643    
## FamUnfamSpeciesUnfamiliar_ZEBI                      0.000495 ***
## FamUnfamSpeciesWN_WN                                 < 2e-16 ***
## Type0NS1                                            0.001299 ** 
## Type0NS2                                            0.000137 ***
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_BEFI   0.046825 *  
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_BEFI 4.28e-05 ***
## Treatment.yIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   0.698787    
## Treatment.yxfostered:FamUnfamSpeciesUnfamiliar_ZEBI 1.25e-07 ***
## Treatment.yIsolate:FamUnfamSpeciesWN_WN              < 2e-16 ***
## Treatment.yxfostered:FamUnfamSpeciesWN_WN           1.34e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(NCMstimnb15,pairwise~"FamUnfamSpecies","Treatment.y")
## $emmeans
## Treatment.y = normal:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       2.22 0.115 Inf      2.00      2.45
##  Unfamiliar_BEFI   2.20 0.115 Inf      1.98      2.43
##  Unfamiliar_ZEBI   2.30 0.116 Inf      2.07      2.53
##  WN_WN             1.29 0.117 Inf      1.06      1.52
## 
## Treatment.y = Isolate:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       2.61 0.177 Inf      2.26      2.95
##  Unfamiliar_BEFI   2.52 0.176 Inf      2.17      2.86
##  Unfamiliar_ZEBI   2.67 0.177 Inf      2.32      3.02
##  WN_WN             2.29 0.178 Inf      1.94      2.64
## 
## Treatment.y = xfostered:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       2.34 0.118 Inf      2.11      2.57
##  Unfamiliar_BEFI   2.47 0.116 Inf      2.24      2.70
##  Unfamiliar_ZEBI   2.21 0.116 Inf      1.98      2.44
##  WN_WN             1.66 0.117 Inf      1.43      1.89
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment.y = normal:
##  contrast                          estimate     SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.0180 0.0191 Inf   0.941  0.7827
##  Father_ZEBI - Unfamiliar_ZEBI      -0.0783 0.0225 Inf  -3.484  0.0028
##  Father_ZEBI - WN_WN                 0.9306 0.0289 Inf  32.154  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.0963 0.0198 Inf  -4.871  <.0001
##  Unfamiliar_BEFI - WN_WN             0.9126 0.0270 Inf  33.844  <.0001
##  Unfamiliar_ZEBI - WN_WN             1.0089 0.0295 Inf  34.250  <.0001
## 
## Treatment.y = Isolate:
##  contrast                          estimate     SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.0909 0.0313 Inf   2.907  0.0191
##  Father_ZEBI - Unfamiliar_ZEBI      -0.0620 0.0357 Inf  -1.734  0.3060
##  Father_ZEBI - WN_WN                 0.3190 0.0386 Inf   8.264  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.1528 0.0311 Inf  -4.910  <.0001
##  Unfamiliar_BEFI - WN_WN             0.2281 0.0345 Inf   6.616  <.0001
##  Unfamiliar_ZEBI - WN_WN             0.3809 0.0385 Inf   9.888  <.0001
## 
## Treatment.y = xfostered:
##  contrast                          estimate     SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      -0.1308 0.0309 Inf  -4.229  0.0001
##  Father_ZEBI - Unfamiliar_ZEBI       0.1280 0.0319 Inf   4.011  0.0004
##  Father_ZEBI - WN_WN                 0.6755 0.0343 Inf  19.672  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   0.2587 0.0188 Inf  13.734  <.0001
##  Unfamiliar_BEFI - WN_WN             0.8063 0.0245 Inf  32.887  <.0001
##  Unfamiliar_ZEBI - WN_WN             0.5476 0.0240 Inf  22.854  <.0001
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(NCMstimnb15,pairwise~"FamUnfamSpecies","Treatment.y",type="response")
## $emmeans
## Treatment.y = normal:
##  FamUnfamSpecies response    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI         9.23 1.065 Inf      7.36     11.57
##  Unfamiliar_BEFI     9.06 1.042 Inf      7.23     11.35
##  Unfamiliar_ZEBI     9.98 1.153 Inf      7.96     12.52
##  WN_WN               3.64 0.426 Inf      2.89      4.58
## 
## Treatment.y = Isolate:
##  FamUnfamSpecies response    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI        13.56 2.399 Inf      9.58     19.17
##  Unfamiliar_BEFI    12.38 2.180 Inf      8.76     17.48
##  Unfamiliar_ZEBI    14.42 2.553 Inf     10.19     20.40
##  WN_WN               9.85 1.749 Inf      6.96     13.95
## 
## Treatment.y = xfostered:
##  FamUnfamSpecies response    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI        10.37 1.228 Inf      8.22     13.08
##  Unfamiliar_BEFI    11.82 1.372 Inf      9.41     14.84
##  Unfamiliar_ZEBI     9.13 1.059 Inf      7.27     11.46
##  WN_WN               5.28 0.618 Inf      4.20      6.64
## 
## Results are averaged over the levels of: Type0 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
## Treatment.y = normal:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.018 0.0195 Inf    1   0.941  0.7827
##  Father_ZEBI / Unfamiliar_ZEBI     0.925 0.0208 Inf    1  -3.484  0.0028
##  Father_ZEBI / WN_WN               2.536 0.0734 Inf    1  32.154  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.908 0.0180 Inf    1  -4.871  <.0001
##  Unfamiliar_BEFI / WN_WN           2.491 0.0672 Inf    1  33.844  <.0001
##  Unfamiliar_ZEBI / WN_WN           2.743 0.0808 Inf    1  34.250  <.0001
## 
## Treatment.y = Isolate:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.095 0.0342 Inf    1   2.907  0.0191
##  Father_ZEBI / Unfamiliar_ZEBI     0.940 0.0336 Inf    1  -1.734  0.3060
##  Father_ZEBI / WN_WN               1.376 0.0531 Inf    1   8.264  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.858 0.0267 Inf    1  -4.910  <.0001
##  Unfamiliar_BEFI / WN_WN           1.256 0.0433 Inf    1   6.616  <.0001
##  Unfamiliar_ZEBI / WN_WN           1.464 0.0564 Inf    1   9.888  <.0001
## 
## Treatment.y = xfostered:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     0.877 0.0271 Inf    1  -4.229  0.0001
##  Father_ZEBI / Unfamiliar_ZEBI     1.136 0.0363 Inf    1   4.011  0.0004
##  Father_ZEBI / WN_WN               1.965 0.0675 Inf    1  19.672  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 1.295 0.0244 Inf    1  13.734  <.0001
##  Unfamiliar_BEFI / WN_WN           2.240 0.0549 Inf    1  32.887  <.0001
##  Unfamiliar_ZEBI / WN_WN           1.729 0.0414 Inf    1  22.854  <.0001
## 
## Results are averaged over the levels of: Type0 
## P value adjustment: tukey method for comparing a family of 4 estimates 
## Tests are performed on the log scale
emmeans(NCMstimnb15,pairwise~Treatment.y)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment.y emmean    SE  df asymp.LCL asymp.UCL
##  normal        2.00 0.115 Inf      1.78      2.23
##  Isolate       2.52 0.176 Inf      2.18      2.86
##  xfostered     2.17 0.116 Inf      1.94      2.40
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      -0.515 0.205 Inf  -2.518  0.0316
##  normal - xfostered    -0.166 0.158 Inf  -1.055  0.5420
##  Isolate - xfostered    0.349 0.204 Inf   1.712  0.2005
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(NCMstimnb15,pairwise~Treatment.y,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment.y response    SE  df asymp.LCL asymp.UCL
##  normal          7.42 0.852 Inf      5.93       9.3
##  Isolate        12.43 2.182 Inf      8.81      17.5
##  xfostered       8.77 1.014 Inf      6.99      11.0
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast            ratio    SE  df null z.ratio p.value
##  normal / Isolate    0.597 0.122 Inf    1  -2.518  0.0316
##  normal / xfostered  0.847 0.133 Inf    1  -1.055  0.5420
##  Isolate / xfostered 1.418 0.289 Inf    1   1.712  0.2005
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale
emmeans(NCMstimnb15,pairwise~Type0)
## $emmeans
##  Type0 emmean    SE  df asymp.LCL asymp.UCL
##  Broad   1.97 0.080 Inf      1.82      2.13
##  NS1     2.33 0.124 Inf      2.09      2.58
##  NS2     2.39 0.121 Inf      2.15      2.62
## 
## Results are averaged over the levels of: Treatment.y, FamUnfamSpecies 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate    SE  df z.ratio p.value
##  Broad - NS1  -0.3604 0.112 Inf  -3.216  0.0037
##  Broad - NS2  -0.4138 0.109 Inf  -3.813  0.0004
##  NS1 - NS2    -0.0533 0.145 Inf  -0.369  0.9278
## 
## Results are averaged over the levels of: Treatment.y, FamUnfamSpecies 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(NCMstimnb15,pairwise~Type0,type="response")
## $emmeans
##  Type0 response    SE  df asymp.LCL asymp.UCL
##  Broad      7.2 0.576 Inf      6.15      8.42
##  NS1       10.3 1.277 Inf      8.10     13.15
##  NS2       10.9 1.319 Inf      8.58     13.80
## 
## Results are averaged over the levels of: Treatment.y, FamUnfamSpecies 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast    ratio     SE  df null z.ratio p.value
##  Broad / NS1 0.697 0.0782 Inf    1  -3.216  0.0037
##  Broad / NS2 0.661 0.0717 Inf    1  -3.813  0.0004
##  NS1 / NS2   0.948 0.1372 Inf    1  -0.369  0.9278
## 
## Results are averaged over the levels of: Treatment.y, FamUnfamSpecies 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale

LATENCY

This data is all non-negative, positive integers and is right-skewed. There is one average latency per unit-stimulus combination. Units that did not cross the baseline firing rate in a 5ms bin within the first 400ms after stimulus onset were not included in this analysis.

#use firezals_sum_zebi dataframe
hist(firezals_sum_zebi$Latency)

Field L

Check for best distribution for this data

lat<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiFL)
latlog<-glmmTMB(log(Latency)~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiFL)
latgamma<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),family=Gamma(link = log),data=firezals_sum_zebiFL)
AICtab(lat,latlog,latgamma)

Gamma distribution fits this data best by far. Random effects removed due to low variance: days post fledge, age, clutch, bird ID, hemisphere

Model diagnostics

latgamma0FL<-glmmTMB(Latency~Treatment*FamUnfamSpecies+(1|Unit2),family=Gamma(link = log),data=firezals_sum_zebiFL)
latgammaFL<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass),family=Gamma(link = log),data=firezals_sum_zebiFL)
latgamma2FL<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+Mass+(1|Unit2),family=Gamma(link = log),data=firezals_sum_zebiFL)
AICtab(latgamma0FL,latgammaFL,latgamma2FL)
##             dAIC df
## latgammaFL   0.0 16
## latgamma2FL 27.8 16
## latgamma0FL 42.7 14
#diagnostics check (Dharma package)
simres <- simulateResiduals(latgammaFL)
plot(simres) #KS test is significant and quartile deviations bad, although the plots don't look too bad

testDispersion(simres) #no dispersion issue

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 0.63688, p-value = 0.232
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = NaN, p-value = 1
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') # number of outliers is significant

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 4, observations = 720, p-value = 0.16
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.005555556 0.025729167
## sample estimates:
## outlier frequency (expected: 0.0126111111111111 ) 
##                                       0.005555556

Let’s see if we can improve the diagnostics by adding a dispersion factor.

latgamma<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass),family=Gamma(link = log),data=firezals_sum_zebiFL)
latgammadisp<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass),dispformula = ~1,family=Gamma(link = log),data=firezals_sum_zebiFL)
latgammadisp2<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies,family=Gamma(link = log),data=firezals_sum_zebiFL)
latgammadisp3<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass),dispformula = ~Treatment+FamUnfamSpecies,family=Gamma(link = log),data=firezals_sum_zebiFL)

AICtab(latgamma,latgammadisp,latgammadisp2,latgammadisp3)#,latgammadisp4,latgammadisp5)

The dispersion factor does improve the fit of the model, but does it improve the diagnostics and adherence to model assumptions?

latgammadisp2FL<-glmmTMB(Latency~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies,family=Gamma(link = log),data=firezals_sum_zebiFL)

#diagnostics check (Dharma package)
simres <- simulateResiduals(latgammadisp2FL)
plot(simres) 

testOutliers(simres,type='bootstrap') # outliers no longer a significant problem

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 6, observations = 720, p-value = 0.48
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.004166667 0.022951389
## sample estimates:
## outlier frequency (expected: 0.0123194444444444 ) 
##                                       0.008333333

Looks much better!

Model Inference and Post Hoc Tests

summary(latgammadisp2FL)
##  Family: Gamma  ( log )
## Formula:          
## Latency ~ Treatment * FamUnfamSpecies + TypeFL + (1 | Unit2) +      (1 | Mass)
## Dispersion:               ~Treatment * FamUnfamSpecies
## Data: firezals_sum_zebiFL
## 
##      AIC      BIC   logLik deviance df.resid 
##  -1899.0  -1775.3    976.5  -1953.0      693 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.03786  0.1946  
##  Mass   (Intercept) 0.10843  0.3293  
## Number of obs: 720, groups:  Unit2, 178; Mass, 12
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                       -2.40140    0.17187 -13.972
## TreatmentIsolate                                   0.48755    0.17462   2.792
## Treatmentxfostered                                 0.77479    0.26937   2.876
## FamUnfamSpeciesUnfamiliar_BEFI                     0.16078    0.12697   1.266
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.05502    0.15262  -0.360
## FamUnfamSpeciesWN_WN                              -0.09539    0.16190  -0.589
## TypeFLNarrow                                      -0.25573    0.06984  -3.662
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   -0.14715    0.18100  -0.813
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI -0.69852    0.23097  -3.024
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.25513    0.22372   1.140
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.17689    0.23629  -0.749
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.21428    0.22210   0.965
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -0.41965    0.26192  -1.602
##                                                   Pr(>|z|)    
## (Intercept)                                        < 2e-16 ***
## TreatmentIsolate                                  0.005236 ** 
## Treatmentxfostered                                0.004024 ** 
## FamUnfamSpeciesUnfamiliar_BEFI                    0.205416    
## FamUnfamSpeciesUnfamiliar_ZEBI                    0.718495    
## FamUnfamSpeciesWN_WN                              0.555725    
## TypeFLNarrow                                      0.000251 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   0.416226    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI 0.002492 ** 
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   0.254123    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI 0.454082    
## TreatmentIsolate:FamUnfamSpeciesWN_WN             0.334635    
## Treatmentxfostered:FamUnfamSpeciesWN_WN           0.109108    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Dispersion model:
##                                                   Estimate Std. Error z value
## (Intercept)                                        0.46181    0.18456   2.502
## TreatmentIsolate                                   0.64164    0.31323   2.049
## Treatmentxfostered                                 0.52637    0.39813   1.322
## FamUnfamSpeciesUnfamiliar_BEFI                     0.15691    0.22105   0.710
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.11172    0.24879  -0.449
## FamUnfamSpeciesWN_WN                               0.05634    0.28048   0.201
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   -0.38094    0.37508  -1.016
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI -0.72863    0.48309  -1.508
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   -0.41544    0.41895  -0.992
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.05494    0.46990  -0.117
## TreatmentIsolate:FamUnfamSpeciesWN_WN             -0.03783    0.47247  -0.080
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -0.99002    0.48065  -2.060
##                                                   Pr(>|z|)  
## (Intercept)                                         0.0123 *
## TreatmentIsolate                                    0.0405 *
## Treatmentxfostered                                  0.1861  
## FamUnfamSpeciesUnfamiliar_BEFI                      0.4778  
## FamUnfamSpeciesUnfamiliar_ZEBI                      0.6534  
## FamUnfamSpeciesWN_WN                                0.8408  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI     0.3098  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI   0.1315  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI     0.3214  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI   0.9069  
## TreatmentIsolate:FamUnfamSpeciesWN_WN               0.9362  
## Treatmentxfostered:FamUnfamSpeciesWN_WN             0.0394 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(latgammadisp2FL,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     -2.53 0.144 Inf     -2.81     -2.24
##  Isolate    -1.96 0.156 Inf     -2.26     -1.65
##  xfostered  -2.08 0.159 Inf     -2.39     -1.76
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      -0.568 0.116 Inf  -4.914  <.0001
##  normal - xfostered    -0.451 0.215 Inf  -2.096  0.0907
##  Isolate - xfostered    0.117 0.222 Inf   0.527  0.8582
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(latgammadisp2FL,pairwise~Treatment,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment response     SE  df asymp.LCL asymp.UCL
##  normal      0.0799 0.0115 Inf    0.0602     0.106
##  Isolate     0.1411 0.0220 Inf    0.1039     0.191
##  xfostered   0.1255 0.0200 Inf    0.0918     0.171
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast            ratio     SE  df null z.ratio p.value
##  normal / Isolate    0.567 0.0655 Inf    1  -4.914  <.0001
##  normal / xfostered  0.637 0.1371 Inf    1  -2.096  0.0907
##  Isolate / xfostered 1.124 0.2499 Inf    1   0.527  0.8582
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale
emmeans(latgammadisp2FL,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      -2.53 0.170 Inf     -2.86     -2.20
##  Unfamiliar_BEFI  -2.37 0.151 Inf     -2.66     -2.07
##  Unfamiliar_ZEBI  -2.58 0.174 Inf     -2.92     -2.24
##  WN_WN            -2.62 0.182 Inf     -2.98     -2.27
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      -2.04 0.181 Inf     -2.40     -1.69
##  Unfamiliar_BEFI  -2.03 0.166 Inf     -2.35     -1.70
##  Unfamiliar_ZEBI  -1.84 0.191 Inf     -2.22     -1.47
##  WN_WN            -1.92 0.184 Inf     -2.28     -1.56
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      -1.75 0.208 Inf     -2.16     -1.35
##  Unfamiliar_BEFI  -2.29 0.180 Inf     -2.65     -1.94
##  Unfamiliar_ZEBI  -1.99 0.167 Inf     -2.31     -1.66
##  WN_WN            -2.27 0.212 Inf     -2.68     -1.85
## 
## Results are averaged over the levels of: TypeFL 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      -0.1608 0.127 Inf  -1.266  0.5845
##  Father_ZEBI - Unfamiliar_ZEBI       0.0550 0.153 Inf   0.360  0.9840
##  Father_ZEBI - WN_WN                 0.0954 0.162 Inf   0.589  0.9354
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   0.2158 0.129 Inf   1.673  0.3379
##  Unfamiliar_BEFI - WN_WN             0.2562 0.136 Inf   1.877  0.2380
##  Unfamiliar_ZEBI - WN_WN             0.0404 0.163 Inf   0.248  0.9946
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      -0.0136 0.129 Inf  -0.106  0.9996
##  Father_ZEBI - Unfamiliar_ZEBI      -0.2001 0.164 Inf  -1.219  0.6149
##  Father_ZEBI - WN_WN                -0.1189 0.152 Inf  -0.782  0.8629
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.1865 0.148 Inf  -1.261  0.5876
##  Unfamiliar_BEFI - WN_WN            -0.1053 0.135 Inf  -0.779  0.8641
##  Unfamiliar_ZEBI - WN_WN             0.0812 0.169 Inf   0.482  0.9631
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.5377 0.193 Inf   2.788  0.0272
##  Father_ZEBI - Unfamiliar_ZEBI       0.2319 0.180 Inf   1.288  0.5707
##  Father_ZEBI - WN_WN                 0.5150 0.206 Inf   2.495  0.0606
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.3058 0.120 Inf  -2.548  0.0528
##  Unfamiliar_BEFI - WN_WN            -0.0227 0.182 Inf  -0.125  0.9993
##  Unfamiliar_ZEBI - WN_WN             0.2831 0.168 Inf   1.685  0.3317
## 
## Results are averaged over the levels of: TypeFL 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(latgammadisp2FL,pairwise~"FamUnfamSpecies","Treatment",type="response")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies response     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       0.0797 0.0135 Inf    0.0572     0.111
##  Unfamiliar_BEFI   0.0936 0.0142 Inf    0.0696     0.126
##  Unfamiliar_ZEBI   0.0755 0.0131 Inf    0.0537     0.106
##  WN_WN             0.0725 0.0132 Inf    0.0507     0.104
## 
## Treatment = Isolate:
##  FamUnfamSpecies response     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       0.1298 0.0235 Inf    0.0910     0.185
##  Unfamiliar_BEFI   0.1316 0.0219 Inf    0.0950     0.182
##  Unfamiliar_ZEBI   0.1586 0.0303 Inf    0.1091     0.231
##  WN_WN             0.1462 0.0270 Inf    0.1019     0.210
## 
## Treatment = xfostered:
##  FamUnfamSpecies response     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       0.1730 0.0359 Inf    0.1151     0.260
##  Unfamiliar_BEFI   0.1010 0.0182 Inf    0.0710     0.144
##  Unfamiliar_ZEBI   0.1372 0.0229 Inf    0.0989     0.190
##  WN_WN             0.1034 0.0219 Inf    0.0682     0.157
## 
## Results are averaged over the levels of: TypeFL 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
## Treatment = normal:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     0.851 0.1081 Inf    1  -1.266  0.5845
##  Father_ZEBI / Unfamiliar_ZEBI     1.057 0.1613 Inf    1   0.360  0.9840
##  Father_ZEBI / WN_WN               1.100 0.1781 Inf    1   0.589  0.9354
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 1.241 0.1600 Inf    1   1.673  0.3379
##  Unfamiliar_BEFI / WN_WN           1.292 0.1763 Inf    1   1.877  0.2380
##  Unfamiliar_ZEBI / WN_WN           1.041 0.1693 Inf    1   0.248  0.9946
## 
## Treatment = Isolate:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     0.986 0.1273 Inf    1  -0.106  0.9996
##  Father_ZEBI / Unfamiliar_ZEBI     0.819 0.1344 Inf    1  -1.219  0.6149
##  Father_ZEBI / WN_WN               0.888 0.1351 Inf    1  -0.782  0.8629
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.830 0.1227 Inf    1  -1.261  0.5876
##  Unfamiliar_BEFI / WN_WN           0.900 0.1216 Inf    1  -0.779  0.8641
##  Unfamiliar_ZEBI / WN_WN           1.085 0.1828 Inf    1   0.482  0.9631
## 
## Treatment = xfostered:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.712 0.3302 Inf    1   2.788  0.0272
##  Father_ZEBI / Unfamiliar_ZEBI     1.261 0.2271 Inf    1   1.288  0.5707
##  Father_ZEBI / WN_WN               1.674 0.3455 Inf    1   2.495  0.0606
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.737 0.0884 Inf    1  -2.548  0.0528
##  Unfamiliar_BEFI / WN_WN           0.978 0.1778 Inf    1  -0.125  0.9993
##  Unfamiliar_ZEBI / WN_WN           1.327 0.2231 Inf    1   1.685  0.3317
## 
## Results are averaged over the levels of: TypeFL 
## P value adjustment: tukey method for comparing a family of 4 estimates 
## Tests are performed on the log scale
emmeans(latgammadisp2FL,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     -2.53 0.170 Inf     -2.86     -2.20
##  Isolate    -2.04 0.181 Inf     -2.40     -1.69
##  xfostered  -1.75 0.208 Inf     -2.16     -1.35
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     -2.37 0.151 Inf     -2.66     -2.07
##  Isolate    -2.03 0.166 Inf     -2.35     -1.70
##  xfostered  -2.29 0.180 Inf     -2.65     -1.94
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     -2.58 0.174 Inf     -2.92     -2.24
##  Isolate    -1.84 0.191 Inf     -2.22     -1.47
##  xfostered  -1.99 0.167 Inf     -2.31     -1.66
## 
## FamUnfamSpecies = WN_WN:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     -2.62 0.182 Inf     -2.98     -2.27
##  Isolate    -1.92 0.184 Inf     -2.28     -1.56
##  xfostered  -2.27 0.212 Inf     -2.68     -1.85
## 
## Results are averaged over the levels of: TypeFL 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.4876 0.175 Inf  -2.792  0.0145
##  normal - xfostered   -0.7748 0.269 Inf  -2.876  0.0112
##  Isolate - xfostered  -0.2872 0.275 Inf  -1.046  0.5481
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.3404 0.138 Inf  -2.466  0.0364
##  normal - xfostered   -0.0763 0.235 Inf  -0.324  0.9437
##  Isolate - xfostered   0.2641 0.245 Inf   1.077  0.5283
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.7427 0.185 Inf  -4.022  0.0002
##  normal - xfostered   -0.5979 0.241 Inf  -2.482  0.0348
##  Isolate - xfostered   0.1448 0.254 Inf   0.571  0.8357
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.7018 0.188 Inf  -3.729  0.0006
##  normal - xfostered   -0.3551 0.280 Inf  -1.270  0.4121
##  Isolate - xfostered   0.3467 0.280 Inf   1.237  0.4311
## 
## Results are averaged over the levels of: TypeFL 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates

NCM

Check for best distribution for this data

lat<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiNCM) #does not converge
latlog<-glmmTMB(log(Latency)~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiNCM)
latgamma<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),family=Gamma(link = log),data=firezals_sum_zebiNCM)
latgamma2<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),family=Gamma(link = log),data=firezals_sum_zebiNCM)
AICtab(lat,latlog,latgamma,latgamma2)

Random effects removed due to low variance: all except for Unit ID Gamma distribution fits this data best by far. Let’s look check out the diagnostics.

Model diagnostics

latgamma2<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),family=Gamma(link = log),data=firezals_sum_zebiNCM)
#diagnostics check (Dharma package)
simres <- simulateResiduals(latgamma2)
plot(simres) #all tests significant, although the plots don't look too bad

testDispersion(simres) #some minor dispersion issues, but does not look bad

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 0.74253, p-value = 0.024
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = NaN, p-value = 1
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') # number of outliers is significant

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 0, observations = 561, p-value < 2.2e-16
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.005347594 0.021390374
## sample estimates:
## outlier frequency (expected: 0.0118181818181818 ) 
##                                                 0

Let’s see if we can improve the diagnostics by adding a dispersion factor and removing outliers.

latgamma2<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),family=Gamma(link = log),data=firezals_sum_zebiNCM)
latgammadisp<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),dispformula = ~1,family=Gamma(link = log),data=firezals_sum_zebiNCM)
latgammadisp2<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),dispformula = ~Treatment*FamUnfamSpecies+Type0,family=Gamma(link = log),data=firezals_sum_zebiNCM)
latgammadisp3<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),dispformula = ~Treatment+FamUnfamSpecies+Type0,family=Gamma(link = log),data=firezals_sum_zebiNCM)
latgammadisp4<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),dispformula = ~Treatment*FamUnfamSpecies,family=Gamma(link = log),data=firezals_sum_zebiNCM)

AICtab(latgamma2,latgammadisp,latgammadisp2,latgammadisp3,latgammadisp4)

latgammadisp3 is top model by >2 deltaAIC. The dispersion factor improved the fit of the model! Does it improve the diagnostics and adherence to model assumptions?

latgammadisp3NCM<-glmmTMB(Latency~Treatment*FamUnfamSpecies+Type0+(1|Unit2),dispformula = ~Treatment+FamUnfamSpecies+Type0,family=Gamma(link = log),data=firezals_sum_zebiNCM)

#diagnostics check (Dharma package)
simres <- simulateResiduals(latgammadisp3NCM)
plot(simres) 

testDispersion(simres) #some minor dispersion issues, but does not look bad

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 0.85854, p-value = 0.224
## alternative hypothesis: two.sided
testZeroInflation(simres) #no zero inflation

## 
##  DHARMa zero-inflation test via comparison to expected zeros with
##  simulation under H0 = fitted model
## 
## data:  simulationOutput
## ratioObsSim = NaN, p-value = 1
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') #still marginal outlier issue, but p = 0.06

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 2, observations = 561, p-value = 0.08
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.003565062 0.023172906
## sample estimates:
## outlier frequency (expected: 0.0127272727272727 ) 
##                                       0.003565062

All looks very good!

Model Inference and Post Hoc Tests

summary(latgammadisp3NCM)
##  Family: Gamma  ( log )
## Formula:          Latency ~ Treatment * FamUnfamSpecies + Type0 + (1 | Unit2)
## Dispersion:               ~Treatment + FamUnfamSpecies + Type0
## Data: firezals_sum_zebiNCM
## 
##      AIC      BIC   logLik deviance df.resid 
##  -1273.0  -1173.4    659.5  -1319.0      538 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.03506  0.1872  
## Number of obs: 561, groups:  Unit2, 149
## 
## Conditional model:
##                                                    Estimate Std. Error z value
## (Intercept)                                       -1.974350   0.098103 -20.125
## TreatmentIsolate                                  -0.210327   0.159879  -1.316
## Treatmentxfostered                                 0.477794   0.184626   2.588
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.234754   0.122121  -1.922
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.259785   0.141391  -1.837
## FamUnfamSpeciesWN_WN                              -0.229775   0.171974  -1.336
## Type0NS1                                          -0.230908   0.106238  -2.173
## Type0NS2                                          -0.031798   0.098628  -0.322
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.331388   0.198679   1.668
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI -0.223650   0.219378  -1.019
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.415767   0.230265   1.806
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.120069   0.222582   0.539
## TreatmentIsolate:FamUnfamSpeciesWN_WN             -0.005966   0.264946  -0.023
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -0.427246   0.269280  -1.587
##                                                   Pr(>|z|)    
## (Intercept)                                        < 2e-16 ***
## TreatmentIsolate                                   0.18833    
## Treatmentxfostered                                 0.00966 ** 
## FamUnfamSpeciesUnfamiliar_BEFI                     0.05457 .  
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.06616 .  
## FamUnfamSpeciesWN_WN                               0.18152    
## Type0NS1                                           0.02974 *  
## Type0NS2                                           0.74715    
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.09532 .  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.30798    
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.07098 .  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.58958    
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.98203    
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.11260    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Dispersion model:
##                                Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                     0.71594    0.16321   4.386 1.15e-05 ***
## TreatmentIsolate                0.60893    0.16641   3.659 0.000253 ***
## Treatmentxfostered              0.53826    0.13757   3.913 9.13e-05 ***
## FamUnfamSpeciesUnfamiliar_BEFI -0.42382    0.17385  -2.438 0.014775 *  
## FamUnfamSpeciesUnfamiliar_ZEBI -0.32689    0.18858  -1.733 0.083007 .  
## FamUnfamSpeciesWN_WN           -0.45505    0.20957  -2.171 0.029908 *  
## Type0NS1                       -0.07448    0.16818  -0.443 0.657881    
## Type0NS2                       -0.01529    0.17214  -0.089 0.929232    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(latgammadisp3NCM,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean     SE  df asymp.LCL asymp.UCL
##  normal     -2.24 0.0671 Inf     -2.37     -2.11
##  Isolate    -2.27 0.0861 Inf     -2.44     -2.10
##  xfostered  -1.90 0.0673 Inf     -2.03     -1.77
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate     SE  df z.ratio p.value
##  normal - Isolate       0.025 0.0995 Inf   0.252  0.9657
##  normal - xfostered    -0.345 0.0861 Inf  -4.008  0.0002
##  Isolate - xfostered   -0.370 0.0992 Inf  -3.733  0.0006
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(latgammadisp3NCM,pairwise~Treatment,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment response      SE  df asymp.LCL asymp.UCL
##  normal       0.106 0.00712 Inf    0.0931     0.121
##  Isolate      0.104 0.00891 Inf    0.0874     0.123
##  xfostered    0.150 0.01009 Inf    0.1314     0.171
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast            ratio     SE  df null z.ratio p.value
##  normal / Isolate    1.025 0.1020 Inf    1   0.252  0.9657
##  normal / xfostered  0.708 0.0610 Inf    1  -4.008  0.0002
##  Isolate / xfostered 0.691 0.0685 Inf    1  -3.733  0.0006
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale
emmeans(latgammadisp3NCM,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      -2.06 0.1000 Inf     -2.26     -1.87
##  Unfamiliar_BEFI  -2.30 0.0895 Inf     -2.47     -2.12
##  Unfamiliar_ZEBI  -2.32 0.1161 Inf     -2.55     -2.09
##  WN_WN            -2.29 0.1499 Inf     -2.59     -2.00
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      -2.27 0.1344 Inf     -2.54     -2.01
##  Unfamiliar_BEFI  -2.18 0.1158 Inf     -2.40     -1.95
##  Unfamiliar_ZEBI  -2.12 0.1454 Inf     -2.40     -1.83
##  WN_WN            -2.51 0.1697 Inf     -2.84     -2.18
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      -1.58 0.1574 Inf     -1.89     -1.28
##  Unfamiliar_BEFI  -2.04 0.0984 Inf     -2.24     -1.85
##  Unfamiliar_ZEBI  -1.72 0.0801 Inf     -1.88     -1.57
##  WN_WN            -2.24 0.1349 Inf     -2.51     -1.98
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.23475 0.122 Inf   1.922  0.2186
##  Father_ZEBI - Unfamiliar_ZEBI      0.25979 0.141 Inf   1.837  0.2558
##  Father_ZEBI - WN_WN                0.22977 0.172 Inf   1.336  0.5398
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.02503 0.136 Inf   0.184  0.9978
##  Unfamiliar_BEFI - WN_WN           -0.00498 0.167 Inf  -0.030  1.0000
##  Unfamiliar_ZEBI - WN_WN           -0.03001 0.182 Inf  -0.165  0.9984
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.09663 0.157 Inf  -0.614  0.9275
##  Father_ZEBI - Unfamiliar_ZEBI     -0.15598 0.182 Inf  -0.857  0.8271
##  Father_ZEBI - WN_WN                0.23574 0.203 Inf   1.164  0.6498
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.05935 0.169 Inf  -0.351  0.9851
##  Unfamiliar_BEFI - WN_WN            0.33237 0.190 Inf   1.745  0.3002
##  Unfamiliar_ZEBI - WN_WN            0.39172 0.208 Inf   1.883  0.2353
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.45840 0.181 Inf   2.534  0.0549
##  Father_ZEBI - Unfamiliar_ZEBI      0.13972 0.173 Inf   0.810  0.8498
##  Father_ZEBI - WN_WN                0.65702 0.205 Inf   3.211  0.0072
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.31869 0.116 Inf  -2.746  0.0307
##  Unfamiliar_BEFI - WN_WN            0.19862 0.156 Inf   1.276  0.5783
##  Unfamiliar_ZEBI - WN_WN            0.51730 0.147 Inf   3.512  0.0025
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(latgammadisp3NCM,pairwise~"FamUnfamSpecies","Treatment",type="response")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies response     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       0.1272 0.0127 Inf    0.1046     0.155
##  Unfamiliar_BEFI   0.1006 0.0090 Inf    0.0844     0.120
##  Unfamiliar_ZEBI   0.0981 0.0114 Inf    0.0781     0.123
##  WN_WN             0.1011 0.0152 Inf    0.0754     0.136
## 
## Treatment = Isolate:
##  FamUnfamSpecies response     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       0.1031 0.0139 Inf    0.0792     0.134
##  Unfamiliar_BEFI   0.1135 0.0131 Inf    0.0905     0.142
##  Unfamiliar_ZEBI   0.1205 0.0175 Inf    0.0906     0.160
##  WN_WN             0.0814 0.0138 Inf    0.0584     0.114
## 
## Treatment = xfostered:
##  FamUnfamSpecies response     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI       0.2051 0.0323 Inf    0.1507     0.279
##  Unfamiliar_BEFI   0.1297 0.0128 Inf    0.1070     0.157
##  Unfamiliar_ZEBI   0.1784 0.0143 Inf    0.1525     0.209
##  WN_WN             0.1063 0.0143 Inf    0.0816     0.139
## 
## Results are averaged over the levels of: Type0 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
## Treatment = normal:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.265 0.1544 Inf    1   1.922  0.2186
##  Father_ZEBI / Unfamiliar_ZEBI     1.297 0.1833 Inf    1   1.837  0.2558
##  Father_ZEBI / WN_WN               1.258 0.2164 Inf    1   1.336  0.5398
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 1.025 0.1392 Inf    1   0.184  0.9978
##  Unfamiliar_BEFI / WN_WN           0.995 0.1662 Inf    1  -0.030  1.0000
##  Unfamiliar_ZEBI / WN_WN           0.970 0.1765 Inf    1  -0.165  0.9984
## 
## Treatment = Isolate:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     0.908 0.1428 Inf    1  -0.614  0.9275
##  Father_ZEBI / Unfamiliar_ZEBI     0.856 0.1558 Inf    1  -0.857  0.8271
##  Father_ZEBI / WN_WN               1.266 0.2564 Inf    1   1.164  0.6498
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.942 0.1591 Inf    1  -0.351  0.9851
##  Unfamiliar_BEFI / WN_WN           1.394 0.2655 Inf    1   1.745  0.3002
##  Unfamiliar_ZEBI / WN_WN           1.480 0.3078 Inf    1   1.883  0.2353
## 
## Treatment = xfostered:
##  contrast                          ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI     1.582 0.2861 Inf    1   2.534  0.0549
##  Father_ZEBI / Unfamiliar_ZEBI     1.150 0.1984 Inf    1   0.810  0.8498
##  Father_ZEBI / WN_WN               1.929 0.3947 Inf    1   3.211  0.0072
##  Unfamiliar_BEFI / Unfamiliar_ZEBI 0.727 0.0844 Inf    1  -2.746  0.0307
##  Unfamiliar_BEFI / WN_WN           1.220 0.1899 Inf    1   1.276  0.5783
##  Unfamiliar_ZEBI / WN_WN           1.678 0.2471 Inf    1   3.512  0.0025
## 
## Results are averaged over the levels of: Type0 
## P value adjustment: tukey method for comparing a family of 4 estimates 
## Tests are performed on the log scale
emmeans(latgammadisp3NCM,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean     SE  df asymp.LCL asymp.UCL
##  normal     -2.06 0.1000 Inf     -2.26     -1.87
##  Isolate    -2.27 0.1344 Inf     -2.54     -2.01
##  xfostered  -1.58 0.1574 Inf     -1.89     -1.28
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean     SE  df asymp.LCL asymp.UCL
##  normal     -2.30 0.0895 Inf     -2.47     -2.12
##  Isolate    -2.18 0.1158 Inf     -2.40     -1.95
##  xfostered  -2.04 0.0984 Inf     -2.24     -1.85
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean     SE  df asymp.LCL asymp.UCL
##  normal     -2.32 0.1161 Inf     -2.55     -2.09
##  Isolate    -2.12 0.1454 Inf     -2.40     -1.83
##  xfostered  -1.72 0.0801 Inf     -1.88     -1.57
## 
## FamUnfamSpecies = WN_WN:
##  Treatment emmean     SE  df asymp.LCL asymp.UCL
##  normal     -2.29 0.1499 Inf     -2.59     -2.00
##  Isolate    -2.51 0.1697 Inf     -2.84     -2.18
##  xfostered  -2.24 0.1349 Inf     -2.51     -1.98
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      0.2103 0.160 Inf   1.316  0.3865
##  normal - xfostered   -0.4778 0.185 Inf  -2.588  0.0261
##  Isolate - xfostered  -0.6881 0.205 Inf  -3.363  0.0022
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.1211 0.140 Inf  -0.867  0.6609
##  normal - xfostered   -0.2541 0.126 Inf  -2.015  0.1086
##  Isolate - xfostered  -0.1331 0.143 Inf  -0.929  0.6218
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.2054 0.181 Inf  -1.135  0.4927
##  normal - xfostered   -0.5979 0.136 Inf  -4.399  <.0001
##  Isolate - xfostered  -0.3924 0.160 Inf  -2.455  0.0375
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      0.2163 0.222 Inf   0.974  0.5932
##  normal - xfostered   -0.0505 0.196 Inf  -0.258  0.9641
##  Isolate - xfostered  -0.2668 0.211 Inf  -1.266  0.4147
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(latgammadisp3NCM,pairwise~Type0)
## $emmeans
##  Type0 emmean     SE  df asymp.LCL asymp.UCL
##  Broad  -2.05 0.0432 Inf     -2.13     -1.96
##  NS1    -2.28 0.1012 Inf     -2.48     -2.08
##  NS2    -2.08 0.0915 Inf     -2.26     -1.90
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate     SE  df z.ratio p.value
##  Broad - NS1   0.2309 0.1062 Inf   2.173  0.0758
##  Broad - NS2   0.0318 0.0986 Inf   0.322  0.9443
##  NS1 - NS2    -0.1991 0.1351 Inf  -1.473  0.3038
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## Results are given on the log (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(latgammadisp3NCM,pairwise~Type0,type="response")
## $emmeans
##  Type0 response      SE  df asymp.LCL asymp.UCL
##  Broad    0.129 0.00557 Inf    0.1184     0.140
##  NS1      0.102 0.01036 Inf    0.0839     0.125
##  NS2      0.125 0.01142 Inf    0.1044     0.149
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale 
## 
## $contrasts
##  contrast    ratio    SE  df null z.ratio p.value
##  Broad / NS1 1.260 0.134 Inf    1   2.173  0.0758
##  Broad / NS2 1.032 0.102 Inf    1   0.322  0.9443
##  NS1 / NS2   0.819 0.111 Inf    1  -1.473  0.3038
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log scale

Z-SCORE

These data are continuous and can be positive or negative. They look relatively normal with a small tail to the right, so there could be some outliers. The best distribution to model residuals from these might be gaussian, but let’s verify that.

#use firezals_sum_zebiFL and firezals_sum_zebiNCM dfs
#Remove the 1 NA Z-score row
firezals_sum_zebiNCM_noNAs<-subset(firezals_sum_zebiNCM,Z_score!="NA")
#histograms
hist(firezals_sum_zebiFL$Z_score)

hist(firezals_sum_zebiNCM_noNAs$Z_score)

Field L

Model Creation

z0<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiFL)
summary(z0)

Random effects removed due to low variance: ID.x (bird ID), clutch, age, days post fledge

z<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere),data=firezals_sum_zebiFL)
z1<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+Mass+(1|Unit2)+(1|Hemisphere),data=firezals_sum_zebiFL)
z2<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiFL)
z3<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+Mass+Hemisphere+(1|Unit2),data=firezals_sum_zebiFL)
AICtab(z,z1,z2,z3)

Model fit is best with Mass as a random effect instead of a fixed effect. Model z2 is the best by deltaAIC = 5.6.

Diagnostics

z2FL<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiFL)

#diagnostics check (Dharma package)
simres <- simulateResiduals(z2FL)
plot(simres)

testDispersion(simres) #NS

## 
##  DHARMa nonparametric dispersion test via sd of residuals fitted vs.
##  simulated
## 
## data:  simulationOutput
## dispersion = 1.0547, p-value = 0.6
## alternative hypothesis: two.sided
testOutliers(simres,type='bootstrap') # NS

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 18, observations = 814, p-value = 0.22
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.002457002 0.029484029
## sample estimates:
## outlier frequency (expected: 0.0123095823095823 ) 
##                                        0.02211302

The KS test shows deviation from uniformity and there are also some quantile deviations. The outlier test no longer significant after bootstrapping. Let’s still try to remove outliers and see if this looks significantly better.

firezals_sum_zebiFL_outliersremoved<-cbind(firezals_sum_zebiFL,simres$scaledResiduals) #scaled residuals based on z2 model
colnames(firezals_sum_zebiFL_outliersremoved)[49]<-'scaledResiduals'
firezals_sum_zebiFL_outliersremoved<-subset(firezals_sum_zebiFL_outliersremoved,scaledResiduals>0 & scaledResiduals<1)
z2FL_nooutliers<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiFL_outliersremoved)
AICtab(z2FL,z2FL_nooutliers)
##                 dAIC  df
## z2FL_nooutliers   0.0 17
## z2FL            235.3 17
simres2 <- simulateResiduals(z2FL_nooutliers)
plot(simres2)

Diagnostics look a bit better and the fit is much better (based on AIC), so let’s use the model without outliers.

NOTE: THERE IS NO LINK SCALE FOR THIS MODEL, SO ESTIMATES ARE ALREADY ON THE RESPONSE SCALE.

Model Inference and Post Hoc Tests

summary(z2FL_nooutliers)
##  Family: gaussian  ( identity )
## Formula:          
## Z_score ~ Treatment * FamUnfamSpecies + TypeFL + Hemisphere +  
##     (1 | Unit2) + (1 | Mass)
## Data: firezals_sum_zebiFL_outliersremoved
## 
##      AIC      BIC   logLik deviance df.resid 
##   1733.0   1812.6   -849.5   1699.0      779 
## 
## Random effects:
## 
## Conditional model:
##  Groups   Name        Variance Std.Dev.
##  Unit2    (Intercept) 0.2235   0.4727  
##  Mass     (Intercept) 0.2704   0.5200  
##  Residual             0.3540   0.5950  
## Number of obs: 796, groups:  Unit2, 177; Mass, 12
## 
## Dispersion estimate for gaussian family (sigma^2): 0.354 
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                        1.37795    0.23480   5.869
## TreatmentIsolate                                  -0.65278    0.19078  -3.422
## Treatmentxfostered                                -0.39412    0.35124  -1.122
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.38142    0.09336  -4.085
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.33532    0.10827  -3.097
## FamUnfamSpeciesWN_WN                              -0.98609    0.10910  -9.038
## TypeFLNarrow                                       0.54713    0.09227   5.930
## HemisphereR                                        0.54561    0.09556   5.709
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.19632    0.15301   1.283
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.49888    0.16626   3.001
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.64313    0.17602   3.654
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.29903    0.17378   1.721
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.17996    0.17652   1.019
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -0.09149    0.17575  -0.521
##                                                   Pr(>|z|)    
## (Intercept)                                       4.39e-09 ***
## TreatmentIsolate                                  0.000623 ***
## Treatmentxfostered                                0.261830    
## FamUnfamSpeciesUnfamiliar_BEFI                    4.40e-05 ***
## FamUnfamSpeciesUnfamiliar_ZEBI                    0.001955 ** 
## FamUnfamSpeciesWN_WN                               < 2e-16 ***
## TypeFLNarrow                                      3.03e-09 ***
## HemisphereR                                       1.13e-08 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   0.199464    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI 0.002695 ** 
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   0.000258 ***
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI 0.085307 .  
## TreatmentIsolate:FamUnfamSpeciesWN_WN             0.307969    
## Treatmentxfostered:FamUnfamSpeciesWN_WN           0.602660    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(z2FL_nooutliers,pairwise~"Treatment")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal      1.50 0.217 779    1.072     1.93
##  Isolate     1.10 0.235 779    0.639     1.56
##  xfostered   1.28 0.244 779    0.803     1.76
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate       0.398 0.155 779   2.564  0.0284
##  normal - xfostered     0.218 0.327 779   0.666  0.7833
##  Isolate - xfostered   -0.180 0.338 779  -0.534  0.8548
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(z2FL_nooutliers,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.924 0.227 779    1.478    2.371
##  Unfamiliar_BEFI  1.543 0.221 779    1.109    1.977
##  Unfamiliar_ZEBI  1.589 0.228 779    1.142    2.036
##  WN_WN            0.938 0.229 779    0.490    1.387
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.272 0.251 779    0.778    1.765
##  Unfamiliar_BEFI  1.086 0.241 779    0.613    1.560
##  Unfamiliar_ZEBI  1.579 0.250 779    1.088    2.071
##  WN_WN            0.465 0.250 779   -0.026    0.957
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.530 0.267 779    1.005    2.055
##  Unfamiliar_BEFI  1.648 0.250 779    1.158    2.138
##  Unfamiliar_ZEBI  1.494 0.247 779    1.009    1.979
##  WN_WN            0.453 0.250 779   -0.038    0.943
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.3814 0.0934 779   4.085  0.0003
##  Father_ZEBI - Unfamiliar_ZEBI       0.3353 0.1083 779   3.097  0.0109
##  Father_ZEBI - WN_WN                 0.9861 0.1091 779   9.038  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.0461 0.0940 779  -0.491  0.9612
##  Unfamiliar_BEFI - WN_WN             0.6047 0.0948 779   6.379  <.0001
##  Unfamiliar_ZEBI - WN_WN             0.6508 0.1096 779   5.935  <.0001
## 
## Treatment = Isolate:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.1851 0.1212 779   1.527  0.4218
##  Father_ZEBI - Unfamiliar_ZEBI      -0.3078 0.1388 779  -2.218  0.1192
##  Father_ZEBI - WN_WN                 0.8061 0.1388 779   5.809  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.4929 0.1189 779  -4.147  0.0002
##  Unfamiliar_BEFI - WN_WN             0.6210 0.1189 779   5.225  <.0001
##  Unfamiliar_ZEBI - WN_WN             1.1139 0.1365 779   8.160  <.0001
## 
## Treatment = xfostered:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      -0.1175 0.1376 779  -0.854  0.8285
##  Father_ZEBI - Unfamiliar_ZEBI       0.0363 0.1359 779   0.267  0.9933
##  Father_ZEBI - WN_WN                 1.0776 0.1378 779   7.821  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   0.1537 0.0867 779   1.773  0.2870
##  Unfamiliar_BEFI - WN_WN             1.1950 0.0954 779  12.526  <.0001
##  Unfamiliar_ZEBI - WN_WN             1.0413 0.0874 779  11.911  <.0001
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(z2FL_nooutliers,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     1.924 0.227 779    1.478    2.371
##  Isolate    1.272 0.251 779    0.778    1.765
##  xfostered  1.530 0.267 779    1.005    2.055
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     1.543 0.221 779    1.109    1.977
##  Isolate    1.086 0.241 779    0.613    1.560
##  xfostered  1.648 0.250 779    1.158    2.138
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     1.589 0.228 779    1.142    2.036
##  Isolate    1.579 0.250 779    1.088    2.071
##  xfostered  1.494 0.247 779    1.009    1.979
## 
## FamUnfamSpecies = WN_WN:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     0.938 0.229 779    0.490    1.387
##  Isolate    0.465 0.250 779   -0.026    0.957
##  xfostered  0.453 0.250 779   -0.038    0.943
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     0.65278 0.191 779   3.422  0.0019
##  normal - xfostered   0.39412 0.351 779   1.122  0.5007
##  Isolate - xfostered -0.25866 0.366 779  -0.706  0.7601
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     0.45646 0.169 779   2.707  0.0190
##  normal - xfostered  -0.10475 0.334 779  -0.314  0.9471
##  Isolate - xfostered -0.56121 0.346 779  -1.620  0.2378
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     0.00965 0.190 779   0.051  0.9986
##  normal - xfostered   0.09510 0.336 779   0.283  0.9569
##  Isolate - xfostered  0.08545 0.351 779   0.243  0.9679
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     0.47282 0.190 779   2.488  0.0348
##  normal - xfostered   0.48562 0.339 779   1.433  0.3243
##  Isolate - xfostered  0.01280 0.353 779   0.036  0.9993
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates

NCM

Model Creation

z0<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiNCM)
z<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiNCM)
z00<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Hemisphere)+(1|ID.x),data=firezals_sum_zebiNCM)
AICtab(z,z0,z00)
summary(z)

Random effects removed due to low variance: Mass, age, days post fledge, clutch

z00<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Hemisphere)+(1|ID.x),data=firezals_sum_zebiNCM)
z1<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=firezals_sum_zebiNCM)
z2<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|ID.x),data=firezals_sum_zebiNCM)
AICtab(z,z1,z2)

Model fit is improved with hemisphere as a fixed effect. Model z1 is the best fit by 7.6 deltaAIC.

Diagnostics

z1NCM<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=firezals_sum_zebiNCM)

#diagnostics check (Dharma package)
simres <- simulateResiduals(z1NCM)
plot(simres)

testOutliers(simres,type='bootstrap') # NS

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 11, observations = 684, p-value = 0.48
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.004385965 0.022697368
## sample estimates:
## outlier frequency (expected: 0.0125877192982456 ) 
##                                        0.01608187

The KS test shows significant deviation from uniformity and there are also some quantile deviations. The outlier test is no longer significant after bootstrapping, but may still be an issue. Let’s try to remove them and see if this looks significantly better.

firezals_sum_zebiNCM_outliersremoved<-cbind(firezals_sum_zebiNCM_noNAs,simres$scaledResiduals) #scaled residuals based on z1 model
colnames(firezals_sum_zebiNCM_outliersremoved)[49]<-'scaledResiduals'
firezals_sum_zebiNCM_outliersremoved<-subset(firezals_sum_zebiNCM_outliersremoved,scaledResiduals>0 & scaledResiduals<1)
z1NCM_nooutliers<-glmmTMB(Z_score~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=firezals_sum_zebiNCM_outliersremoved)
AICtab(z1NCM,z1NCM_nooutliers)
##                  dAIC  df
## z1NCM_nooutliers   0.0 18
## z1NCM            200.3 18
simres2 <- simulateResiduals(z1NCM_nooutliers)
plot(simres2)

Diagnostics look a bit better and the fit is much better (based on AIC), so let’s use the model without outliers.

NOTE: THERE IS NO LINK SCALE FOR THIS MODEL, SO ESTIMATES ARE ALREADY ON THE RESPONSE SCALE.

Model Inference and Post Hoc Tests

summary(z1NCM_nooutliers)
##  Family: gaussian  ( identity )
## Formula:          Z_score ~ Treatment * FamUnfamSpecies + Type0 + Hemisphere +  
##     (1 | Unit2) + (1 | ID.x)
## Data: firezals_sum_zebiNCM_outliersremoved
## 
##      AIC      BIC   logLik deviance df.resid 
##   1326.6   1407.8   -645.3   1290.6      655 
## 
## Random effects:
## 
## Conditional model:
##  Groups   Name        Variance Std.Dev.
##  Unit2    (Intercept) 0.12046  0.3471  
##  ID.x     (Intercept) 0.04772  0.2184  
##  Residual             0.31038  0.5571  
## Number of obs: 673, groups:  Unit2, 150; ID.x, 16
## 
## Dispersion estimate for gaussian family (sigma^2): 0.31 
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                        1.39862    0.13323  10.498
## TreatmentIsolate                                  -0.52940    0.23422  -2.260
## Treatmentxfostered                                -0.79538    0.22000  -3.615
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.25093    0.08655  -2.899
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.18761    0.09942  -1.887
## FamUnfamSpeciesWN_WN                              -1.49013    0.09988 -14.919
## Type0NS1                                           0.29128    0.11098   2.625
## Type0NS2                                          -0.03722    0.10727  -0.347
## HemisphereR                                        0.32912    0.08472   3.885
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.04603    0.16927   0.272
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.63852    0.18826   3.392
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.37118    0.19519   1.902
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.13507    0.19252   0.702
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.93211    0.19543   4.770
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.71323    0.19480   3.661
##                                                   Pr(>|z|)    
## (Intercept)                                        < 2e-16 ***
## TreatmentIsolate                                  0.023807 *  
## Treatmentxfostered                                0.000300 ***
## FamUnfamSpeciesUnfamiliar_BEFI                    0.003741 ** 
## FamUnfamSpeciesUnfamiliar_ZEBI                    0.059149 .  
## FamUnfamSpeciesWN_WN                               < 2e-16 ***
## Type0NS1                                          0.008673 ** 
## Type0NS2                                          0.728637    
## HemisphereR                                       0.000102 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   0.785663    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI 0.000695 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   0.057225 .  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI 0.482920    
## TreatmentIsolate:FamUnfamSpeciesWN_WN             1.85e-06 ***
## Treatmentxfostered:FamUnfamSpeciesWN_WN           0.000251 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(z1NCM_nooutliers,pairwise~"Treatment")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     1.166 0.111 655    0.947    1.384
##  Isolate    0.974 0.172 655    0.636    1.311
##  xfostered  0.742 0.117 655    0.512    0.972
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate       0.192 0.200 655   0.960  0.6027
##  normal - xfostered     0.424 0.157 655   2.698  0.0196
##  Isolate - xfostered    0.232 0.199 655   1.162  0.4763
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(z1NCM_nooutliers,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI     1.6479 0.127 655   1.3976    1.898
##  Unfamiliar_BEFI 1.3969 0.118 655   1.1658    1.628
##  Unfamiliar_ZEBI 1.4603 0.127 655   1.2100    1.711
##  WN_WN           0.1577 0.128 655  -0.0938    0.409
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI     1.1185 0.201 655   0.7231    1.514
##  Unfamiliar_BEFI 0.9136 0.183 655   0.5542    1.273
##  Unfamiliar_ZEBI 1.3020 0.201 655   0.9067    1.697
##  WN_WN           0.5605 0.201 655   0.1651    0.956
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI     0.8525 0.184 655   0.4920    1.213
##  Unfamiliar_BEFI 1.2401 0.129 655   0.9869    1.493
##  Unfamiliar_ZEBI 0.8000 0.123 655   0.5590    1.041
##  WN_WN           0.0756 0.129 655  -0.1779    0.329
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.2509 0.0866 655   2.899  0.0202
##  Father_ZEBI - Unfamiliar_ZEBI       0.1876 0.0994 655   1.887  0.2346
##  Father_ZEBI - WN_WN                 1.4901 0.0999 655  14.919  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.0633 0.0864 655  -0.733  0.8838
##  Unfamiliar_BEFI - WN_WN             1.2392 0.0871 655  14.223  <.0001
##  Unfamiliar_ZEBI - WN_WN             1.3025 0.0999 655  13.037  <.0001
## 
## Treatment = Isolate:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.2049 0.1455 655   1.408  0.4944
##  Father_ZEBI - Unfamiliar_ZEBI      -0.1836 0.1680 655  -1.093  0.6941
##  Father_ZEBI - WN_WN                 0.5580 0.1680 655   3.322  0.0052
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.3885 0.1455 655  -2.670  0.0388
##  Unfamiliar_BEFI - WN_WN             0.3531 0.1455 655   2.427  0.0730
##  Unfamiliar_ZEBI - WN_WN             0.7416 0.1680 655   4.415  0.0001
## 
## Treatment = xfostered:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      -0.3876 0.1672 655  -2.318  0.0949
##  Father_ZEBI - Unfamiliar_ZEBI       0.0525 0.1649 655   0.319  0.9888
##  Father_ZEBI - WN_WN                 0.7769 0.1673 655   4.645  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   0.4401 0.0887 655   4.962  <.0001
##  Unfamiliar_BEFI - WN_WN             1.1645 0.0986 655  11.808  <.0001
##  Unfamiliar_ZEBI - WN_WN             0.7244 0.0885 655   8.181  <.0001
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(z1NCM_nooutliers,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal    1.6479 0.127 655   1.3976    1.898
##  Isolate   1.1185 0.201 655   0.7231    1.514
##  xfostered 0.8525 0.184 655   0.4920    1.213
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal    1.3969 0.118 655   1.1658    1.628
##  Isolate   0.9136 0.183 655   0.5542    1.273
##  xfostered 1.2401 0.129 655   0.9869    1.493
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal    1.4603 0.127 655   1.2100    1.711
##  Isolate   1.3020 0.201 655   0.9067    1.697
##  xfostered 0.8000 0.123 655   0.5590    1.041
## 
## FamUnfamSpecies = WN_WN:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal    0.1577 0.128 655  -0.0938    0.409
##  Isolate   0.5605 0.201 655   0.1651    0.956
##  xfostered 0.0756 0.129 655  -0.1779    0.329
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      0.5294 0.234 655   2.260  0.0623
##  normal - xfostered    0.7954 0.220 655   3.615  0.0009
##  Isolate - xfostered   0.2660 0.266 655   1.001  0.5765
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      0.4834 0.213 655   2.266  0.0614
##  normal - xfostered    0.1569 0.170 655   0.920  0.6275
##  Isolate - xfostered  -0.3265 0.216 655  -1.512  0.2860
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      0.1582 0.234 655   0.675  0.7781
##  normal - xfostered    0.6603 0.173 655   3.823  0.0004
##  Isolate - xfostered   0.5021 0.228 655   2.200  0.0719
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     -0.4027 0.235 655  -1.716  0.1998
##  normal - xfostered    0.0822 0.178 655   0.462  0.8889
##  Isolate - xfostered   0.4849 0.232 655   2.092  0.0922
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(z1NCM_nooutliers,pairwise~"Type0")
## $emmeans
##  Type0 emmean     SE  df lower.CL upper.CL
##  Broad  0.876 0.0791 655    0.720     1.03
##  NS1    1.167 0.1231 655    0.925     1.41
##  NS2    0.839 0.1193 655    0.604     1.07
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate    SE  df t.ratio p.value
##  Broad - NS1  -0.2913 0.111 655  -2.625  0.0241
##  Broad - NS2   0.0372 0.107 655   0.347  0.9358
##  NS1 - NS2     0.3285 0.143 655   2.294  0.0573
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates

D PRIME

The data is continuous, but can be negative. Looks like a fairly symmetrical bell curve with only a small number of very large value outliers.

#NOTE: 5 units cannot be analyzed here because they did not hear white noise (units from C4 trials 4 and 5)
#use the dprime_zebi df
#remove befi units
dprime_zebi<-subset(dprime,Treatment!="BEFI")
#remove FosterFather stimulus
dprime_zebi<-subset(dprime_zebi,FamUnfamSpecies!="FosterFather_BEFI")
#Make "normal" treatment the reference level
dprime_zebi$Treatment<-relevel(as.factor(dprime_zebi$Treatment),ref=2)
#Make "Field L" the reference level unit type
dprime_zebi$Type0<-relevel(as.factor(dprime_zebi$Type0),ref=2)
#Create separate dataframes for Field L and NCM
dprime_zebi_FL<-subset(dprime_zebi,Region=="FL")
dprime_zebi_NCM<-subset(dprime_zebi,Region=="NCM")

#quick plot to view data
hist(dprime$dprime)

CDF analysis (white noise as comparison)

#cdf plot
ggplot(dprime_zebi, aes(x=dprime, group =Treatment,color=Treatment)) + stat_ecdf()+facet_wrap(~Region~FamUnfamSpecies)

#levene.dat.aov<-aov(dprime~Treatment*(FamUnfamSpecies+Region),dprime_zebi)
levene.dat.aov<-aov(dprime~Treatment*FamUnfamSpecies*Region,dprime_zebi)
summary(levene.dat.aov)
##                                    Df Sum Sq Mean Sq F value   Pr(>F)    
## Treatment                           2   55.0   27.49  13.876 1.11e-06 ***
## FamUnfamSpecies                     2   20.1   10.03   5.063 0.006467 ** 
## Region                              1    8.0    7.99   4.034 0.044837 *  
## Treatment:FamUnfamSpecies           4   44.4   11.09   5.599 0.000183 ***
## Treatment:Region                    2   90.9   45.43  22.932 1.72e-10 ***
## FamUnfamSpecies:Region              2    5.9    2.95   1.489 0.226102    
## Treatment:FamUnfamSpecies:Region    4    4.9    1.24   0.625 0.645026    
## Residuals                        1138 2254.7    1.98                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(levene.dat.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = dprime ~ Treatment * FamUnfamSpecies * Region, data = dprime_zebi)
## 
## $Treatment
##                         diff         lwr         upr     p adj
## Isolate-normal    -0.5798768 -0.84066260 -0.31909108 0.0000006
## xfostered-normal  -0.2540616 -0.47269986 -0.03542343 0.0178152
## xfostered-Isolate  0.3258152  0.05987742  0.59175297 0.0114557
## 
## $FamUnfamSpecies
##                                        diff        lwr         upr     p adj
## Unfamiliar_BEFI-Father_ZEBI     -0.34561391 -0.6083757 -0.08285208 0.0058716
## Unfamiliar_ZEBI-Father_ZEBI     -0.29531453 -0.5670044 -0.02362470 0.0292644
## Unfamiliar_ZEBI-Unfamiliar_BEFI  0.05029938 -0.1677876  0.26838631 0.8509558
## 
## $Region
##             diff         lwr       upr     p adj
## NCM-FL 0.1658416 0.002799934 0.3288833 0.0461997
## 
## $`Treatment:FamUnfamSpecies`
##                                                             diff        lwr
## Isolate:Father_ZEBI-normal:Father_ZEBI              -0.833943597 -1.5246403
## xfostered:Father_ZEBI-normal:Father_ZEBI            -0.122317781 -0.8685027
## normal:Unfamiliar_BEFI-normal:Father_ZEBI           -0.513911289 -1.0009566
## Isolate:Unfamiliar_BEFI-normal:Father_ZEBI          -1.078278362 -1.6418402
## xfostered:Unfamiliar_BEFI-normal:Father_ZEBI        -0.334835643 -0.8709643
## normal:Unfamiliar_ZEBI-normal:Father_ZEBI           -0.164008704 -0.7264002
## Isolate:Unfamiliar_ZEBI-normal:Father_ZEBI          -0.520838331 -1.2115350
## xfostered:Unfamiliar_ZEBI-normal:Father_ZEBI        -0.775616449 -1.2647211
## xfostered:Father_ZEBI-Isolate:Father_ZEBI            0.711625816 -0.1354690
## normal:Unfamiliar_BEFI-Isolate:Father_ZEBI           0.320032308 -0.3108329
## Isolate:Unfamiliar_BEFI-Isolate:Father_ZEBI         -0.244334765 -0.9359848
## xfostered:Unfamiliar_BEFI-Isolate:Father_ZEBI        0.499107954 -0.1703782
## normal:Unfamiliar_ZEBI-Isolate:Father_ZEBI           0.669934893 -0.0207618
## Isolate:Unfamiliar_ZEBI-Isolate:Father_ZEBI          0.313105266 -0.4855434
## xfostered:Unfamiliar_ZEBI-Isolate:Father_ZEBI        0.058327148 -0.5741293
## normal:Unfamiliar_BEFI-xfostered:Father_ZEBI        -0.391593508 -1.0827670
## Isolate:Unfamiliar_BEFI-xfostered:Father_ZEBI       -0.955960581 -1.7030280
## xfostered:Unfamiliar_BEFI-xfostered:Father_ZEBI     -0.212517862 -0.9391138
## normal:Unfamiliar_ZEBI-xfostered:Father_ZEBI        -0.041690923 -0.7878758
## Isolate:Unfamiliar_ZEBI-xfostered:Father_ZEBI       -0.398520550 -1.2456154
## xfostered:Unfamiliar_ZEBI-xfostered:Father_ZEBI     -0.653298668 -1.3459249
## Isolate:Unfamiliar_BEFI-normal:Unfamiliar_BEFI      -0.564367073 -1.0527634
## xfostered:Unfamiliar_BEFI-normal:Unfamiliar_BEFI     0.179075645 -0.2773922
## normal:Unfamiliar_ZEBI-normal:Unfamiliar_BEFI        0.349902585 -0.1371427
## Isolate:Unfamiliar_ZEBI-normal:Unfamiliar_BEFI      -0.006927042 -0.6377922
## xfostered:Unfamiliar_ZEBI-normal:Unfamiliar_BEFI    -0.261705161 -0.6618956
## xfostered:Unfamiliar_BEFI-Isolate:Unfamiliar_BEFI    0.743442719  0.2060865
## normal:Unfamiliar_ZEBI-Isolate:Unfamiliar_BEFI       0.914269658  0.3507078
## Isolate:Unfamiliar_ZEBI-Isolate:Unfamiliar_BEFI      0.557440031 -0.1342100
## xfostered:Unfamiliar_ZEBI-Isolate:Unfamiliar_BEFI    0.302661913 -0.1877881
## normal:Unfamiliar_ZEBI-xfostered:Unfamiliar_BEFI     0.170826940 -0.3653017
## Isolate:Unfamiliar_ZEBI-xfostered:Unfamiliar_BEFI   -0.186002687 -0.8554888
## xfostered:Unfamiliar_ZEBI-xfostered:Unfamiliar_BEFI -0.440780806 -0.8994453
## Isolate:Unfamiliar_ZEBI-normal:Unfamiliar_ZEBI      -0.356829627 -1.0475263
## xfostered:Unfamiliar_ZEBI-normal:Unfamiliar_ZEBI    -0.611607746 -1.1007124
## xfostered:Unfamiliar_ZEBI-Isolate:Unfamiliar_ZEBI   -0.254778119 -0.8872346
##                                                             upr     p adj
## Isolate:Father_ZEBI-normal:Father_ZEBI              -0.14324690 0.0057382
## xfostered:Father_ZEBI-normal:Father_ZEBI             0.62386710 0.9998857
## normal:Unfamiliar_BEFI-normal:Father_ZEBI           -0.02686600 0.0295619
## Isolate:Unfamiliar_BEFI-normal:Father_ZEBI          -0.51471648 0.0000001
## xfostered:Unfamiliar_BEFI-normal:Father_ZEBI         0.20129298 0.5852458
## normal:Unfamiliar_ZEBI-normal:Father_ZEBI            0.39838275 0.9926453
## Isolate:Unfamiliar_ZEBI-normal:Father_ZEBI           0.16985836 0.3168909
## xfostered:Unfamiliar_ZEBI-normal:Father_ZEBI        -0.28651177 0.0000335
## xfostered:Father_ZEBI-Isolate:Father_ZEBI            1.55872065 0.1831097
## normal:Unfamiliar_BEFI-Isolate:Father_ZEBI           0.95089750 0.8176196
## Isolate:Unfamiliar_BEFI-Isolate:Father_ZEBI          0.44731527 0.9745857
## xfostered:Unfamiliar_BEFI-Isolate:Father_ZEBI        1.16859408 0.3326633
## normal:Unfamiliar_ZEBI-Isolate:Father_ZEBI           1.36063159 0.0655076
## Isolate:Unfamiliar_ZEBI-Isolate:Father_ZEBI          1.11175393 0.9525456
## xfostered:Unfamiliar_ZEBI-Isolate:Father_ZEBI        0.69078360 0.9999987
## normal:Unfamiliar_BEFI-xfostered:Father_ZEBI         0.29958002 0.7081701
## Isolate:Unfamiliar_BEFI-xfostered:Father_ZEBI       -0.20889316 0.0024067
## xfostered:Unfamiliar_BEFI-xfostered:Father_ZEBI      0.51407806 0.9924988
## normal:Unfamiliar_ZEBI-xfostered:Father_ZEBI         0.70449396 1.0000000
## Isolate:Unfamiliar_ZEBI-xfostered:Father_ZEBI        0.44857428 0.8728024
## xfostered:Unfamiliar_ZEBI-xfostered:Father_ZEBI      0.03932759 0.0824682
## Isolate:Unfamiliar_BEFI-normal:Unfamiliar_BEFI      -0.07597076 0.0103342
## xfostered:Unfamiliar_BEFI-normal:Unfamiliar_BEFI     0.63554346 0.9523604
## normal:Unfamiliar_ZEBI-normal:Unfamiliar_BEFI        0.83694787 0.3850318
## Isolate:Unfamiliar_ZEBI-normal:Unfamiliar_BEFI       0.62393815 1.0000000
## xfostered:Unfamiliar_ZEBI-normal:Unfamiliar_BEFI     0.13848524 0.5209211
## xfostered:Unfamiliar_BEFI-Isolate:Unfamiliar_BEFI    1.28079898 0.0006262
## normal:Unfamiliar_ZEBI-Isolate:Unfamiliar_BEFI       1.47783154 0.0000189
## Isolate:Unfamiliar_ZEBI-Isolate:Unfamiliar_BEFI      1.24909007 0.2306247
## xfostered:Unfamiliar_ZEBI-Isolate:Unfamiliar_BEFI    0.79311195 0.6014483
## normal:Unfamiliar_ZEBI-xfostered:Unfamiliar_BEFI     0.70695557 0.9867901
## Isolate:Unfamiliar_ZEBI-xfostered:Unfamiliar_BEFI    0.48348344 0.9947058
## xfostered:Unfamiliar_ZEBI-xfostered:Unfamiliar_BEFI  0.01788372 0.0708223
## Isolate:Unfamiliar_ZEBI-normal:Unfamiliar_ZEBI       0.33386707 0.8019415
## xfostered:Unfamiliar_ZEBI-normal:Unfamiliar_ZEBI    -0.12250306 0.0034411
## xfostered:Unfamiliar_ZEBI-Isolate:Unfamiliar_ZEBI    0.37767833 0.9445283
## 
## $`Treatment:Region`
##                                   diff        lwr         upr     p adj
## Isolate:FL-normal:FL        0.05139914 -0.3664801  0.46927842 0.9993000
## xfostered:FL-normal:FL      0.21088728 -0.1578394  0.57961401 0.5769771
## normal:NCM-normal:FL        0.79266149  0.4272741  1.15804892 0.0000000
## Isolate:NCM-normal:FL      -0.56256138 -1.0644276 -0.06069519 0.0176930
## xfostered:NCM-normal:FL     0.07929112 -0.3106569  0.46923917 0.9923130
## xfostered:FL-Isolate:FL     0.15948814 -0.2573624  0.57633872 0.8846081
## normal:NCM-Isolate:FL       0.74126235  0.3273626  1.15516206 0.0000055
## Isolate:NCM-Isolate:FL     -0.61396052 -1.1521749 -0.07574618 0.0147293
## xfostered:NCM-Isolate:FL    0.02789198 -0.4078424  0.46362640 0.9999719
## normal:NCM-xfostered:FL     0.58177420  0.2175637  0.94598470 0.0000829
## Isolate:NCM-xfostered:FL   -0.77344866 -1.2744586 -0.27243870 0.0001666
## xfostered:NCM-xfostered:FL -0.13159617 -0.5204416  0.25724930 0.9285578
## Isolate:NCM-normal:NCM     -1.35522286 -1.8537803 -0.85666539 0.0000000
## xfostered:NCM-normal:NCM   -0.71337037 -1.0990508 -0.32768997 0.0000023
## xfostered:NCM-Isolate:NCM   0.64185249  0.1250246  1.15868038 0.0054568
## 
## $`FamUnfamSpecies:Region`
##                                                diff         lwr         upr
## Unfamiliar_BEFI:FL-Father_ZEBI:FL       -0.45207307 -0.88266085 -0.02148528
## Unfamiliar_ZEBI:FL-Father_ZEBI:FL       -0.26496137 -0.71163725  0.18171450
## Father_ZEBI:NCM-Father_ZEBI:FL           0.08827174 -0.44595861  0.62250210
## Unfamiliar_BEFI:NCM-Father_ZEBI:FL      -0.13299102 -0.57617515  0.31019310
## Unfamiliar_ZEBI:NCM-Father_ZEBI:FL      -0.24569257 -0.70432267  0.21293754
## Unfamiliar_ZEBI:FL-Unfamiliar_BEFI:FL    0.18711169 -0.17438594  0.54860932
## Father_ZEBI:NCM-Unfamiliar_BEFI:FL       0.54034481  0.07498122  1.00570840
## Unfamiliar_BEFI:NCM-Unfamiliar_BEFI:FL   0.31908204 -0.03809210  0.67625618
## Unfamiliar_ZEBI:NCM-Unfamiliar_BEFI:FL   0.20638050 -0.16978804  0.58254904
## Father_ZEBI:NCM-Unfamiliar_ZEBI:FL       0.35323312 -0.12705510  0.83352133
## Unfamiliar_BEFI:NCM-Unfamiliar_ZEBI:FL   0.13197035 -0.24444281  0.50838351
## Unfamiliar_ZEBI:NCM-Unfamiliar_ZEBI:FL   0.01926881 -0.37521347  0.41375109
## Unfamiliar_BEFI:NCM-Father_ZEBI:NCM     -0.22126277 -0.69830533  0.25577979
## Unfamiliar_ZEBI:NCM-Father_ZEBI:NCM     -0.33396431 -0.82538979  0.15746117
## Unfamiliar_ZEBI:NCM-Unfamiliar_BEFI:NCM -0.11270154 -0.50322568  0.27782259
##                                             p adj
## Unfamiliar_BEFI:FL-Father_ZEBI:FL       0.0331336
## Unfamiliar_ZEBI:FL-Father_ZEBI:FL       0.5364901
## Father_ZEBI:NCM-Father_ZEBI:FL          0.9971005
## Unfamiliar_BEFI:NCM-Father_ZEBI:FL      0.9565167
## Unfamiliar_ZEBI:NCM-Father_ZEBI:FL      0.6453983
## Unfamiliar_ZEBI:FL-Unfamiliar_BEFI:FL   0.6787799
## Father_ZEBI:NCM-Unfamiliar_BEFI:FL      0.0121489
## Unfamiliar_BEFI:NCM-Unfamiliar_BEFI:FL  0.1107809
## Unfamiliar_ZEBI:NCM-Unfamiliar_BEFI:FL  0.6211612
## Father_ZEBI:NCM-Unfamiliar_ZEBI:FL      0.2882137
## Unfamiliar_BEFI:NCM-Unfamiliar_ZEBI:FL  0.9177285
## Unfamiliar_ZEBI:NCM-Unfamiliar_ZEBI:FL  0.9999927
## Unfamiliar_BEFI:NCM-Father_ZEBI:NCM     0.7717172
## Unfamiliar_ZEBI:NCM-Father_ZEBI:NCM     0.3782300
## Unfamiliar_ZEBI:NCM-Unfamiliar_BEFI:NCM 0.9631674
## 
## $`Treatment:FamUnfamSpecies:Region`
##                                                                     diff
## Isolate:Father_ZEBI:FL-normal:Father_ZEBI:FL                -0.413805210
## xfostered:Father_ZEBI:FL-normal:Father_ZEBI:FL               0.113684592
## normal:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL             -0.743699684
## Isolate:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL            -0.584661316
## xfostered:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL          -0.147478538
## normal:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL             -0.298649230
## Isolate:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL             0.006232307
## xfostered:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL          -0.354303680
## normal:Father_ZEBI:NCM-normal:Father_ZEBI:FL                 0.513342186
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:FL               -0.842269431
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:FL              0.156436123
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL             0.213725072
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL           -1.219636301
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL          0.019228052
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL             0.468209794
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL           -0.726790790
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL         -0.694824542
## xfostered:Father_ZEBI:FL-Isolate:Father_ZEBI:FL              0.527489802
## normal:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL            -0.329894474
## Isolate:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL           -0.170856106
## xfostered:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL          0.266326672
## normal:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL             0.115155980
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL            0.420037517
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL          0.059501530
## normal:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL                0.927147396
## Isolate:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL              -0.428464221
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL             0.570241333
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL            0.627530282
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL          -0.805831091
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL         0.433033262
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL            0.882015004
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL          -0.312985580
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL        -0.281019332
## normal:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL          -0.857384276
## Isolate:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL         -0.698345908
## xfostered:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL       -0.261163131
## normal:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL          -0.412333823
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL         -0.107452285
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL       -0.467988273
## normal:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL              0.399657594
## Isolate:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL            -0.955954023
## xfostered:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL           0.042751531
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL          0.100040480
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL        -1.333320894
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL      -0.094456541
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL          0.354525202
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL        -0.840475382
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL      -0.808509135
## Isolate:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL         0.159038368
## xfostered:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL       0.596221146
## normal:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL          0.445050454
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL         0.749931991
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL       0.389396004
## normal:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL             1.257041870
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL           -0.098569747
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL          0.900135807
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL         0.957424756
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL       -0.475936617
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL      0.762927735
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL         1.211909478
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL        0.016908894
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL      0.048875141
## xfostered:Unfamiliar_BEFI:FL-Isolate:Unfamiliar_BEFI:FL      0.437182777
## normal:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL         0.286012085
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL        0.590893623
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL      0.230357635
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL            1.098003502
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL          -0.257608115
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL         0.741097439
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL        0.798386388
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL      -0.634974986
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL     0.603889367
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL        1.052871110
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL      -0.142129474
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL    -0.110163227
## normal:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL      -0.151170692
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL      0.153710846
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL   -0.206825142
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL          0.660820725
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL        -0.694790893
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL       0.303914662
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL      0.361203611
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL    -1.072157763
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL   0.166706590
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL      0.615688333
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL    -0.579312251
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL  -0.547346004
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL         0.304881537
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL      -0.055654450
## normal:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL             0.811991417
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL           -0.543620201
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL          0.455085354
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL         0.512374303
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL       -0.920987071
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL      0.317877282
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL         0.766859024
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL       -0.428141559
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL     -0.396175312
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_ZEBI:FL     -0.360535987
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL            0.507109879
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL          -0.848501738
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL         0.150203816
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL        0.207492765
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL      -1.225868609
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL     0.012995744
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL        0.461977487
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL      -0.733023097
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL    -0.701056850
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL          0.867645867
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL        -0.487965751
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL       0.510739804
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL      0.568028753
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL    -0.865332621
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL   0.373531732
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL      0.822513474
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL    -0.372487109
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL  -0.340520862
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:NCM              -1.355611617
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:NCM            -0.356906063
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM           -0.299617114
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM          -1.732978488
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM        -0.494114135
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM           -0.045132392
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM          -1.240132976
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM        -1.208166729
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:NCM            0.998705554
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM           1.055994503
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM         -0.377366870
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM        0.861497483
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM           1.310479225
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM          0.115478641
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM        0.147444889
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM         0.057288949
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM       -1.376072425
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM     -0.137208072
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM         0.311773671
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM       -0.883226913
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM     -0.851260666
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM      -1.433361374
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM    -0.194497021
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM        0.254484722
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM      -0.940515862
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM    -0.908549615
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:NCM    1.238864353
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM       1.687846096
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM      0.492845512
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM    0.524811759
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM     0.448981743
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM   -0.746018841
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM -0.714052594
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM      -1.195000584
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM    -1.163034337
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:NCM    0.031966247
##                                                                      lwr
## Isolate:Father_ZEBI:FL-normal:Father_ZEBI:FL                -1.437601167
## xfostered:Father_ZEBI:FL-normal:Father_ZEBI:FL              -0.990022205
## normal:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL             -1.528510484
## Isolate:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL            -1.438703710
## xfostered:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL          -0.985633784
## normal:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL             -1.204870684
## Isolate:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL            -1.017563650
## xfostered:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL          -1.130765192
## normal:Father_ZEBI:NCM-normal:Father_ZEBI:FL                -0.381849792
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:FL               -2.071831651
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:FL             -1.168907373
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL            -0.564730880
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL           -2.200055068
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL         -0.865833563
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL            -0.426982184
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL           -1.956353010
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL         -1.489091235
## xfostered:Father_ZEBI:FL-Isolate:Father_ZEBI:FL             -0.674628966
## normal:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL            -1.247962462
## Isolate:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL           -1.148766762
## xfostered:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL         -0.697740263
## normal:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL            -0.908639977
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL           -0.709156444
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL         -0.851439367
## normal:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL               -0.086898715
## Isolate:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL              -1.747078680
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL            -0.838110975
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL           -0.285111218
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL          -1.895850264
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL        -0.572081110
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL           -0.132031108
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL          -1.631600039
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL        -1.207183691
## normal:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL          -1.863793420
## Isolate:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL         -1.759628050
## xfostered:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL       -1.309702872
## normal:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL          -1.516040620
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL         -1.309571054
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL       -1.467900195
## normal:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL             -0.695011329
## Isolate:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL            -2.337530885
## xfostered:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL          -1.424717977
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL         -0.901420973
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL        -2.498718821
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL      -1.180856759
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL         -0.740143721
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL        -2.222052244
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL      -1.822309387
## Isolate:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL        -0.564894696
## xfostered:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL      -0.108899330
## normal:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL         -0.339760346
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL        -0.168135997
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL      -0.241145944
## normal:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL             0.484993072
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL           -1.241598147
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL         -0.345346450
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL         0.324428438
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL       -1.345368401
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL      0.002648359
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL         0.439860680
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL       -1.126119505
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL     -0.603466984
## xfostered:Unfamiliar_BEFI:FL-Isolate:Unfamiliar_BEFI:FL     -0.344261593
## normal:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL        -0.568030309
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL       -0.387017033
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL     -0.484515478
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL            0.255673539
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL          -1.449234878
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL        -0.549129856
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL        0.081347506
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL      -1.567376212
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL    -0.227666494
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL        0.210541147
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL      -1.333756237
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL    -0.844336686
## normal:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL      -0.989325937
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL     -0.810356089
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL   -0.902640758
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL         -0.165396904
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL        -1.875083291
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL      -0.975851832
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL     -0.336836906
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL    -1.990029132
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL  -0.648524025
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL     -0.210529297
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL    -1.759604650
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL  -1.262976127
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL        -0.718914420
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL      -0.832115962
## normal:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL            -0.083200562
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL           -1.773182421
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL         -0.870258143
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL        -0.266081650
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL       -1.901405837
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL     -0.567184333
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL        -0.128332954
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL       -1.657703779
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL     -1.190442005
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_ZEBI:FL     -1.271476885
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL           -0.506936233
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL          -2.167116197
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL        -1.258148492
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL       -0.705148735
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL      -2.315887781
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL    -0.992118628
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL       -0.552068625
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL      -2.051637556
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL    -1.627221208
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL          0.104085893
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL        -1.625277673
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL      -0.729498295
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL     -0.054585756
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL    -1.727235234
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL  -0.378125915
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL      0.058953500
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL    -1.509799032
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL  -0.982793963
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:NCM              -2.577067555
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:NCM            -1.674732584
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM           -1.065205139
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM          -2.703211610
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM        -1.367879216
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM           -0.929157297
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM          -2.461588914
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM        -1.989825820
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:NCM           -0.565622197
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM          -0.082679989
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM         -1.662593266
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM       -0.352553584
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM           0.089023287
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM         -1.368572969
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM       -1.002096546
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM        -1.184198760
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM       -2.753214037
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM     -1.448174175
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM        -1.006052850
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM       -2.447554665
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM     -2.102722867
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM      -2.297061150
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM    -0.948214745
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM       -0.511103304
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM      -2.079190354
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM    -1.553232426
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:NCM    0.277970136
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM       0.717612973
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM     -0.792380884
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM   -0.353165014
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM    -0.424783338
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM   -1.960069908
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM -1.484089164
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM      -2.416456522
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM    -1.944693428
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:NCM   -1.117575187
##                                                                      upr
## Isolate:Father_ZEBI:FL-normal:Father_ZEBI:FL                 0.609990747
## xfostered:Father_ZEBI:FL-normal:Father_ZEBI:FL               1.217391390
## normal:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL              0.041111116
## Isolate:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL             0.269381079
## xfostered:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL           0.690676707
## normal:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL              0.607572223
## Isolate:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL             1.030028264
## xfostered:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL           0.422157831
## normal:Father_ZEBI:NCM-normal:Father_ZEBI:FL                 1.408534165
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:FL                0.387292789
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:FL              1.481779620
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL             0.992181025
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL           -0.239217535
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL          0.904289666
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL             1.363401772
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL            0.502771430
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL          0.099442151
## xfostered:Father_ZEBI:FL-Isolate:Father_ZEBI:FL              1.729608571
## normal:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL             0.588173514
## Isolate:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL            0.807054550
## xfostered:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL          1.230393606
## normal:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL             1.138951937
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL            1.549231478
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL          0.970442427
## normal:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL                1.941193508
## Isolate:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL               0.890150238
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL             1.978593641
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL            1.540171783
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL           0.284188081
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL         1.438147633
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL            1.896061116
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL           1.005628880
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL         0.645145026
## normal:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL           0.149024867
## Isolate:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL          0.362936234
## xfostered:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL        0.787376610
## normal:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL           0.691372975
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL          1.094666484
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL        0.531923649
## normal:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL              1.494326517
## Isolate:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL             0.425622839
## xfostered:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL           1.510221039
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL          1.101501933
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL        -0.167922966
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL       0.991943677
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL          1.449194124
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL         0.541101480
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL       0.205291118
## Isolate:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL         0.882971432
## xfostered:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL       1.301341621
## normal:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL          1.229861254
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL         1.667999979
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL       1.019937952
## normal:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL             2.029090669
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL            1.044458652
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL          2.145618065
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL         1.590421074
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL        0.393495166
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL      1.523207112
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL         1.983958276
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL        1.159937294
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL      0.701217267
## xfostered:Unfamiliar_BEFI:FL-Isolate:Unfamiliar_BEFI:FL      1.218627148
## normal:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL         1.140054480
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL        1.568804279
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL      0.945230749
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL            1.940333465
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL           0.934018647
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL         2.031324734
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL        1.515425270
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL       0.297426240
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL     1.435445229
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL        1.895201073
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL       1.049497289
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL     0.624010233
## normal:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL       0.686984554
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL      1.117777780
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL    0.488990474
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL          1.487038354
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL         0.485501506
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL       1.583681155
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL      1.059244127
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL    -0.154286394
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL   0.981937204
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL      1.441905962
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL     0.600980147
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL   0.168284119
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL         1.328677494
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL       0.720807061
## normal:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL             1.707183395
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL            0.685942019
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL          1.780428850
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL         1.290830255
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL        0.059431695
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL      1.202938896
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL         1.662051003
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL        0.801420661
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL      0.398091381
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_ZEBI:FL      0.550404910
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL            1.521155991
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL           0.470112721
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL         1.558556124
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL        1.120134266
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL      -0.135849436
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL     1.018110116
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL        1.476023599
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL       0.585591362
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL     0.225107509
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL          1.631205841
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL         0.649346172
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL       1.750977902
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL      1.190643261
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL    -0.003430009
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL   1.125189379
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL      1.586073449
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL     0.764824813
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL   0.301752239
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:NCM              -0.134155680
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:NCM             0.960920458
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM            0.465970911
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM          -0.762745365
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM         0.379650946
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM            0.838892513
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM          -0.018677038
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM        -0.426507638
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:NCM            2.563033306
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM           2.194668996
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM          0.907859525
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM        2.075548549
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM           2.531935163
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM          1.599530252
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM        1.296986323
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM         1.298776658
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM        0.001069187
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM      1.173758031
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM         1.629600192
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM        0.681100839
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM      0.400201536
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM      -0.569661597
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM     0.559220704
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM        1.020072747
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM       0.198158631
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM    -0.263866804
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:NCM    2.199758570
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM       2.658079218
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM      1.778071907
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM    1.402788532
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM     1.322746824
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM    0.468032225
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM  0.055983976
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM       0.026455354
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM    -0.381375246
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:NCM    1.181507682
##                                                                 p adj
## Isolate:Father_ZEBI:FL-normal:Father_ZEBI:FL                0.9951624
## xfostered:Father_ZEBI:FL-normal:Father_ZEBI:FL              1.0000000
## normal:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL             0.0875602
## Isolate:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL            0.6127887
## xfostered:Unfamiliar_BEFI:FL-normal:Father_ZEBI:FL          1.0000000
## normal:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL             0.9996089
## Isolate:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL            1.0000000
## xfostered:Unfamiliar_ZEBI:FL-normal:Father_ZEBI:FL          0.9820344
## normal:Father_ZEBI:NCM-normal:Father_ZEBI:FL                0.8665905
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:FL               0.6116236
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:FL             1.0000000
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL            0.9999680
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL           0.0020014
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:FL         1.0000000
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL            0.9355332
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL           0.8347229
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:FL         0.1746251
## xfostered:Father_ZEBI:FL-Isolate:Father_ZEBI:FL             0.9880328
## normal:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL            0.9988160
## Isolate:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL           1.0000000
## xfostered:Unfamiliar_BEFI:FL-Isolate:Father_ZEBI:FL         0.9999651
## normal:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL            1.0000000
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL           0.9981865
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Father_ZEBI:FL         1.0000000
## normal:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL               0.1216770
## Isolate:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL              0.9996753
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:FL            0.9950641
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL           0.6046912
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL          0.4655510
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:FL        0.9901635
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL           0.1823767
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL          0.9999962
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:FL        0.9998708
## normal:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL          0.2120681
## Isolate:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL         0.6825988
## xfostered:Unfamiliar_BEFI:FL-xfostered:Father_ZEBI:FL       0.9999922
## normal:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL          0.9980887
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL         1.0000000
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Father_ZEBI:FL       0.9768312
## normal:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL             0.9985579
## Isolate:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL            0.5930268
## xfostered:Father_ZEBI:NCM-xfostered:Father_ZEBI:FL          1.0000000
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL         1.0000000
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL        0.0083657
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:FL      1.0000000
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL         0.9996892
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL        0.7999009
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:FL      0.3215069
## Isolate:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL        0.9999988
## xfostered:Unfamiliar_BEFI:FL-normal:Unfamiliar_BEFI:FL      0.2233987
## normal:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL         0.8771015
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL        0.2793892
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_BEFI:FL      0.7799119
## normal:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL            0.0000024
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL           1.0000000
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_BEFI:FL         0.5097571
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL        0.0000219
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL       0.9062613
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:FL     0.0480851
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL        0.0000075
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL       1.0000000
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:FL     1.0000000
## xfostered:Unfamiliar_BEFI:FL-Isolate:Unfamiliar_BEFI:FL     0.8890033
## normal:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL        0.9995176
## Isolate:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL       0.8085025
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_BEFI:FL     0.9997093
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL           0.0007977
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL          0.9999991
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL        0.8649778
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL       0.0125881
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL      0.6223405
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:FL    0.5003613
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL       0.0018295
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL      1.0000000
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:FL    1.0000000
## normal:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL      0.9999999
## Isolate:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL     1.0000000
## xfostered:Unfamiliar_ZEBI:FL-xfostered:Unfamiliar_BEFI:FL   0.9999026
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL         0.3163034
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL        0.8393554
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL      0.9999961
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL     0.9411977
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL    0.0060134
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_BEFI:FL  0.9999996
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL     0.4500178
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL    0.9634278
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:FL  0.3995913
## Isolate:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL        0.9999000
## xfostered:Unfamiliar_ZEBI:FL-normal:Unfamiliar_ZEBI:FL      1.0000000
## normal:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL            0.1303250
## Isolate:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL           0.9870400
## xfostered:Father_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL         0.9993337
## normal:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL        0.6821579
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL       0.0951728
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_ZEBI:FL     0.9988233
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL        0.2039266
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL       0.9992034
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:FL     0.9575724
## xfostered:Unfamiliar_ZEBI:FL-Isolate:Unfamiliar_ZEBI:FL     0.9962033
## normal:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL           0.9565618
## Isolate:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL          0.7191305
## xfostered:Father_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL        1.0000000
## normal:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL       0.9999980
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL      0.0108629
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_ZEBI:FL    1.0000000
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL       0.9823237
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL      0.8942872
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:FL    0.4195959
## normal:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL         0.0092924
## Isolate:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL        0.9905938
## xfostered:Father_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL      0.9940209
## normal:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL     0.1239905
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL    0.0478176
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Unfamiliar_ZEBI:FL  0.9589891
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL     0.0200209
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL    0.9996396
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_ZEBI:FL  0.9277146
## Isolate:Father_ZEBI:NCM-normal:Father_ZEBI:NCM              0.0131972
## xfostered:Father_ZEBI:NCM-normal:Father_ZEBI:NCM            0.9999737
## normal:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM           0.9966711
## Isolate:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM          0.0000001
## xfostered:Unfamiliar_BEFI:NCM-normal:Father_ZEBI:NCM        0.8796297
## normal:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM           1.0000000
## Isolate:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM          0.0420556
## xfostered:Unfamiliar_ZEBI:NCM-normal:Father_ZEBI:NCM        0.0000118
## xfostered:Father_ZEBI:NCM-Isolate:Father_ZEBI:NCM           0.7314578
## normal:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM          0.1072038
## Isolate:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM         0.9999178
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Father_ZEBI:NCM       0.5451931
## normal:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM          0.0211309
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM         1.0000000
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Father_ZEBI:NCM       1.0000000
## normal:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM        1.0000000
## Isolate:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM       0.0504356
## xfostered:Unfamiliar_BEFI:NCM-xfostered:Father_ZEBI:NCM     1.0000000
## normal:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM        0.9999964
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM       0.8810478
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Father_ZEBI:NCM     0.6244688
## Isolate:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM      0.0000013
## xfostered:Unfamiliar_BEFI:NCM-normal:Unfamiliar_BEFI:NCM    0.9999869
## normal:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM       0.9995623
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM      0.2607478
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_BEFI:NCM    0.0001386
## xfostered:Unfamiliar_BEFI:NCM-Isolate:Unfamiliar_BEFI:NCM   0.0009985
## normal:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM      0.0000002
## Isolate:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM     0.9973834
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_BEFI:NCM   0.8217061
## normal:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM    0.9446684
## Isolate:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM   0.7866761
## xfostered:Unfamiliar_ZEBI:NCM-xfostered:Unfamiliar_BEFI:NCM 0.1073008
## Isolate:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM      0.0634262
## xfostered:Unfamiliar_ZEBI:NCM-normal:Unfamiliar_ZEBI:NCM    0.0000344
## xfostered:Unfamiliar_ZEBI:NCM-Isolate:Unfamiliar_ZEBI:NCM   1.0000000

CDF analysis (BEFI as comparison for ZEBI stimuli–THIS IS ONLY THE CASE FOR THIS SECTION)

#read in dprime_species data frame 
#remove befi units
dprime_species2<-subset(dprime_species,Treatment!="BEFI")
#cdf plot
ggplot(data=dprime_species2,aes(x=dprime,color=Treatment))+facet_wrap(~Region)+geom_density()

ggplot(dprime_species2, aes(x=dprime,group=Treatment,color=Treatment))+stat_ecdf()+facet_wrap(~Region)

#boxplot
ggplot(dprime_species2,aes(x=Treatment,y=dprime))+facet_wrap(~Region)+geom_boxplot()+geom_jitter(alpha=0.6)+ stat_summary(fun=mean,geom="point",color="black",shape=18,size=5)

levene.species.aov<-aov(dprime~Treatment*Region,dprime_species2)
summary(levene.species.aov)
##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## Treatment          2  50.13  25.064  27.381 1.04e-11 ***
## Region             1  15.98  15.983  17.461 3.78e-05 ***
## Treatment:Region   2   3.04   1.520   1.661    0.192    
## Residuals        322 294.75   0.915                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(levene.species.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = dprime ~ Treatment * Region, data = dprime_species2)
## 
## $Treatment
##                         diff        lwr        upr     p adj
## normal-Isolate    -0.1709290 -0.5242849  0.1824269 0.4907924
## xfostered-Isolate -0.8953896 -1.2422644 -0.5485148 0.0000000
## xfostered-normal  -0.7244606 -1.0001720 -0.4487492 0.0000000
## 
## $Region
##             diff        lwr        upr    p adj
## NCM-FL -0.440869 -0.6494929 -0.2322452 4.13e-05
## 
## $`Treatment:Region`
##                                   diff         lwr         upr     p adj
## normal:FL-Isolate:FL        0.07690534 -0.48820576  0.64201644 0.9988241
## xfostered:FL-Isolate:FL    -0.65228699 -1.19492645 -0.10964753 0.0083803
## Isolate:NCM-Isolate:FL     -0.02390319 -0.75874518  0.71093880 0.9999990
## normal:NCM-Isolate:FL      -0.42827361 -0.99001934  0.13347212 0.2472460
## xfostered:NCM-Isolate:FL   -1.21111716 -1.77286289 -0.64937143 0.0000000
## xfostered:FL-normal:FL     -0.72919233 -1.19589721 -0.26248744 0.0001507
## Isolate:NCM-normal:FL      -0.10080853 -0.78150568  0.57988863 0.9982332
## normal:NCM-normal:FL       -0.50517895 -0.99396738 -0.01639052 0.0381398
## xfostered:NCM-normal:FL    -1.28802250 -1.77681093 -0.79923407 0.0000000
## Isolate:NCM-xfostered:FL    0.62838380 -0.03377604  1.29054364 0.0739425
## normal:NCM-xfostered:FL     0.22401338 -0.23861084  0.68663759 0.7341318
## xfostered:NCM-xfostered:FL -0.55883017 -1.02145439 -0.09620596 0.0079122
## normal:NCM-Isolate:NCM     -0.40437042 -1.08227626  0.27353542 0.5260546
## xfostered:NCM-Isolate:NCM  -1.18721397 -1.86511981 -0.50930813 0.0000126
## xfostered:NCM-normal:NCM   -0.78284355 -1.26773719 -0.29794991 0.0000779

Units in cross-fostered birds are significantly different from isolate and normal units. On a unit-level, selectivity is shifted toward preference for BEFI songs.

Field L

Model Creation (white noise as the comparison)

d0<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=dprime_zebi_FL)
summary(d0)

Random effects removed due to low variance: bird ID, age, days post fledge

d1<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|Clutch),data=dprime_zebi_FL)
d2<-glmmTMB(dprime~Treatment+FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|Clutch),data=dprime_zebi_FL)
d3<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+Mass+(1|Unit2)+(1|Hemisphere)+(1|Clutch),data=dprime_zebi_FL)
d4<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass)+(1|Clutch),data=dprime_zebi_FL)
d5<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+Mass+Hemisphere+(1|Unit2)+(1|Clutch),data=dprime_zebi_FL)
AICtab(d1,d2,d3,d4,d5)

d4 is the best fit by 1.8 delta AIC over d5.

Model diagnostics

d4FL<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass)+(1|Clutch),data=dprime_zebi_FL)

#diagnostics check (Dharma package)
simres <- simulateResiduals(d4FL)
plot(simres) 

testOutliers(simres,type='bootstrap')

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 15, observations = 627, p-value = 0.2
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.001594896 0.036842105
## sample estimates:
## outlier frequency (expected: 0.012200956937799 ) 
##                                       0.02392344

There are some quantile deviations, but no dispersion or significant outlier issues after bootstrapping. It looks like there might be a large number of outliers even if it isn’t statistically significant, so I will see if removing them improves the quantile deviations.

dprime_zebi_FL_outliersremoved<-cbind(dprime_zebi_FL,simres$scaledResiduals) #scaled residuals based on d4 model
colnames(dprime_zebi_FL_outliersremoved)[54]<-'scaledResiduals'
dprime_zebi_FL_outliersremoved<-subset(dprime_zebi_FL_outliersremoved,scaledResiduals>0 & scaledResiduals<1)
d4FL_nooutliers<-glmmTMB(dprime~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass)+(1|Clutch),data=dprime_zebi_FL_outliersremoved) 

AICtab(d4FL_nooutliers,d4FL)
##                 dAIC df
## d4FL_nooutliers  0   15
## d4FL            94   15
simres <- simulateResiduals(d4FL_nooutliers)
plot(simres) 

Model fit is improved and diagnostics are sliiiightly improved after removing outliers.

NOTE: THERE IS NO LINK SCALE FOR THIS MODEL, SO ESTIMATES ARE ALREADY ON THE RESPONSE SCALE.

Model Inference and Post Hoc Tests

summary(d4FL_nooutliers)
##  Family: gaussian  ( identity )
## Formula:          dprime ~ Treatment * FamUnfamSpecies + TypeFL + Hemisphere +  
##     (1 | Unit2) + (1 | Mass) + (1 | Clutch)
## Data: dprime_zebi_FL_outliersremoved
## 
##      AIC      BIC   logLik deviance df.resid 
##   1709.4   1775.7   -839.7   1679.4      597 
## 
## Random effects:
## 
## Conditional model:
##  Groups   Name        Variance Std.Dev.
##  Unit2    (Intercept) 0.8460   0.9198  
##  Mass     (Intercept) 0.1165   0.3413  
##  Clutch   (Intercept) 0.5805   0.7619  
##  Residual             0.5101   0.7142  
## Number of obs: 612, groups:  Unit2, 174; Mass, 11; Clutch, 5
## 
## Dispersion estimate for gaussian family (sigma^2): 0.51 
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                         0.1803     0.6261   0.288
## TreatmentIsolate                                    0.2487     0.9814   0.253
## Treatmentxfostered                                  1.0474     0.7136   1.468
## FamUnfamSpeciesUnfamiliar_BEFI                     -0.6927     0.1178  -5.880
## FamUnfamSpeciesUnfamiliar_ZEBI                     -0.2767     0.1359  -2.035
## TypeFLNarrow                                        0.4638     0.1691   2.743
## HemisphereR                                         0.8942     0.1719   5.204
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI     0.5218     0.1844   2.829
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI   0.8863     0.2046   4.332
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI     0.6967     0.2129   3.273
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI   0.2777     0.2156   1.288
##                                                   Pr(>|z|)    
## (Intercept)                                        0.77338    
## TreatmentIsolate                                   0.79994    
## Treatmentxfostered                                 0.14216    
## FamUnfamSpeciesUnfamiliar_BEFI                    4.09e-09 ***
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.04181 *  
## TypeFLNarrow                                       0.00609 ** 
## HemisphereR                                       1.96e-07 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.00466 ** 
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI 1.48e-05 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.00107 ** 
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.19765    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(d4FL_nooutliers,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     0.536 0.596 597   -0.634     1.71
##  Isolate    1.191 0.801 597   -0.382     2.76
##  xfostered  1.972 0.489 597    1.011     2.93
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      -0.655 0.973 597  -0.673  0.7793
##  normal - xfostered    -1.435 0.703 597  -2.041  0.1034
##  Isolate - xfostered   -0.781 0.940 597  -0.830  0.6845
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(d4FL_nooutliers,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     0.859 0.601 597  -0.3216     2.04
##  Isolate    1.108 0.807 597  -0.4765     2.69
##  xfostered  1.907 0.503 597   0.9186     2.89
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     0.167 0.597 597  -1.0065     1.34
##  Isolate    0.937 0.803 597  -0.6392     2.51
##  xfostered  2.100 0.494 597   1.1301     3.07
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     0.583 0.601 597  -0.5983     1.76
##  Isolate    1.528 0.807 597  -0.0565     3.11
##  xfostered  1.908 0.493 597   0.9387     2.88
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      -0.249 0.981 597  -0.253  0.9652
##  normal - xfostered    -1.047 0.714 597  -1.468  0.3072
##  Isolate - xfostered   -0.799 0.953 597  -0.838  0.6793
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      -0.771 0.976 597  -0.790  0.7095
##  normal - xfostered    -1.934 0.709 597  -2.726  0.0181
##  Isolate - xfostered   -1.163 0.945 597  -1.232  0.4350
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate      -0.945 0.981 597  -0.963  0.6004
##  normal - xfostered    -1.325 0.713 597  -1.858  0.1521
##  Isolate - xfostered   -0.380 0.948 597  -0.401  0.9154
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(d4FL_nooutliers,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      0.859 0.601 597  -0.3216     2.04
##  Unfamiliar_BEFI  0.167 0.597 597  -1.0065     1.34
##  Unfamiliar_ZEBI  0.583 0.601 597  -0.5983     1.76
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.108 0.807 597  -0.4765     2.69
##  Unfamiliar_BEFI  0.937 0.803 597  -0.6392     2.51
##  Unfamiliar_ZEBI  1.528 0.807 597  -0.0565     3.11
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.907 0.503 597   0.9186     2.89
##  Unfamiliar_BEFI  2.100 0.494 597   1.1301     3.07
##  Unfamiliar_ZEBI  1.908 0.493 597   0.9387     2.88
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.69265 0.118 597   5.880  <.0001
##  Father_ZEBI - Unfamiliar_ZEBI      0.27668 0.136 597   2.035  0.1047
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.41597 0.117 597  -3.545  0.0012
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.17086 0.142 597   1.204  0.4512
##  Father_ZEBI - Unfamiliar_ZEBI     -0.42004 0.164 597  -2.564  0.0285
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.59090 0.142 597  -4.164  0.0001
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.19369 0.167 597  -1.158  0.4790
##  Father_ZEBI - Unfamiliar_ZEBI     -0.00101 0.167 597  -0.006  1.0000
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.19268 0.104 597   1.857  0.1522
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates

NCM

Model Creation (white noise as the comparison)

d0<-glmmTMB(dprime~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=dprime_zebi_NCM)
summary(d0)

Random effects removed due to low variance: clutch ID, age, days post fledge, mass

d1<-glmmTMB(dprime~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|ID.x)+(1|Hemisphere),data=dprime_zebi_NCM)
d2<-glmmTMB(dprime~Treatment+FamUnfamSpecies+Type0+(1|Unit2)+(1|ID.x)+(1|Hemisphere),data=dprime_zebi_NCM)
d3<-glmmTMB(dprime~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=dprime_zebi_NCM)
AICtab(d1,d2,d3)

d3 is the best fit by 4.2 delta AIC over d1. Let’s check diagnostics.

Model diagnostics

d3NCM<-glmmTMB(dprime~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=dprime_zebi_NCM)
#diagnostics check (Dharma package)
simres <- simulateResiduals(d3NCM)
plot(simres) 

testOutliers(simres,type='bootstrap') 

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 10, observations = 529, p-value = 0.24
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.00278828 0.02457467
## sample estimates:
## outlier frequency (expected: 0.0116068052930057 ) 
##                                        0.01890359

KS test shows deviation form uniformity and there are some minor quantile deviations. After bootstrapping, there is no outlier issue. This looks acceptable.

NOTE: THERE IS NO LINK SCALE FOR THIS MODEL, SO ESTIMATES ARE ALREADY ON THE RESPONSE SCALE.

Model Inference and Post Hoc Tests

summary(d3NCM)
##  Family: gaussian  ( identity )
## Formula:          
## dprime ~ Treatment * FamUnfamSpecies + Type0 + Hemisphere + (1 |  
##     Unit2) + (1 | ID.x)
## Data: dprime_zebi_NCM
## 
##      AIC      BIC   logLik deviance df.resid 
##   1625.1   1689.2   -797.6   1595.1      514 
## 
## Random effects:
## 
## Conditional model:
##  Groups   Name        Variance Std.Dev.
##  Unit2    (Intercept) 0.9953   0.9977  
##  ID.x     (Intercept) 0.2203   0.4694  
##  Residual             0.7036   0.8388  
## Number of obs: 529, groups:  Unit2, 148; ID.x, 16
## 
## Dispersion estimate for gaussian family (sigma^2): 0.704 
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                        1.91622    0.29950   6.398
## TreatmentIsolate                                  -1.28810    0.49479  -2.603
## Treatmentxfostered                                -0.88815    0.41917  -2.119
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.29961    0.13047  -2.296
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.04513    0.15066  -0.300
## Type0NS1                                           0.54839    0.27550   1.991
## Type0NS2                                          -0.12010    0.26938  -0.446
## HemisphereR                                        0.59479    0.21717   2.739
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   -0.07775    0.25495  -0.305
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.67016    0.28087   2.386
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.16061    0.29439   0.546
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.23236    0.29019  -0.801
##                                                   Pr(>|z|)    
## (Intercept)                                       1.57e-10 ***
## TreatmentIsolate                                   0.00923 ** 
## Treatmentxfostered                                 0.03411 *  
## FamUnfamSpeciesUnfamiliar_BEFI                     0.02166 *  
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.76452    
## Type0NS1                                           0.04653 *  
## Type0NS2                                           0.65571    
## HemisphereR                                        0.00617 ** 
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.76038    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.01703 *  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.58536    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.42329    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(d3NCM,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     2.241 0.260 514    1.730     2.75
##  Isolate    0.981 0.396 514    0.203     1.76
##  xfostered  1.499 0.264 514    0.980     2.02
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate       1.260 0.462 514   2.728  0.0181
##  normal - xfostered     0.742 0.357 514   2.080  0.0949
##  Isolate - xfostered   -0.518 0.454 514  -1.142  0.4886
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(d3NCM,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     2.356 0.275 514    1.815     2.90
##  Isolate    1.068 0.424 514    0.235     1.90
##  xfostered  1.468 0.333 514    0.815     2.12
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     2.057 0.265 514    1.536     2.58
##  Isolate    0.691 0.405 514   -0.105     1.49
##  xfostered  1.839 0.273 514    1.302     2.38
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df lower.CL upper.CL
##  normal     2.311 0.275 514    1.770     2.85
##  Isolate    1.184 0.424 514    0.350     2.02
##  xfostered  1.191 0.267 514    0.667     1.71
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     1.28810 0.495 514   2.603  0.0257
##  normal - xfostered   0.88815 0.419 514   2.119  0.0870
##  Isolate - xfostered -0.39995 0.520 514  -0.769  0.7221
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     1.36585 0.472 514   2.891  0.0111
##  normal - xfostered   0.21799 0.367 514   0.594  0.8236
##  Isolate - xfostered -1.14786 0.467 514  -2.461  0.0377
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df t.ratio p.value
##  normal - Isolate     1.12749 0.495 514   2.279  0.0597
##  normal - xfostered   1.12051 0.370 514   3.025  0.0074
##  Isolate - xfostered -0.00699 0.480 514  -0.015  0.9999
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(d3NCM,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      2.356 0.275 514    1.815     2.90
##  Unfamiliar_BEFI  2.057 0.265 514    1.536     2.58
##  Unfamiliar_ZEBI  2.311 0.275 514    1.770     2.85
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.068 0.424 514    0.235     1.90
##  Unfamiliar_BEFI  0.691 0.405 514   -0.105     1.49
##  Unfamiliar_ZEBI  1.184 0.424 514    0.350     2.02
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df lower.CL upper.CL
##  Father_ZEBI      1.468 0.333 514    0.815     2.12
##  Unfamiliar_BEFI  1.839 0.273 514    1.302     2.38
##  Unfamiliar_ZEBI  1.191 0.267 514    0.667     1.71
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.2996 0.130 514   2.296  0.0572
##  Father_ZEBI - Unfamiliar_ZEBI       0.0451 0.151 514   0.300  0.9517
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.2545 0.130 514  -1.950  0.1258
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       0.3774 0.219 514   1.723  0.1976
##  Father_ZEBI - Unfamiliar_ZEBI      -0.1155 0.253 514  -0.457  0.8915
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  -0.4928 0.219 514  -2.250  0.0640
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      -0.3705 0.249 514  -1.490  0.2967
##  Father_ZEBI - Unfamiliar_ZEBI       0.2775 0.248 514   1.119  0.5029
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   0.6480 0.133 514   4.890  <.0001
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(d3NCM,pairwise~Type0)
## $emmeans
##  Type0 emmean    SE  df lower.CL upper.CL
##  Broad   1.43 0.183 514    1.071     1.79
##  NS1     1.98 0.296 514    1.397     2.56
##  NS2     1.31 0.288 514    0.745     1.88
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate    SE  df t.ratio p.value
##  Broad - NS1   -0.548 0.276 514  -1.991  0.1155
##  Broad - NS2    0.120 0.269 514   0.446  0.8963
##  NS1 - NS2      0.668 0.358 514   1.867  0.1493
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates

D PRIME: PROPORTION SELECTIVE

This response variable is the proportion of units selective for each stimulus type over white noise.

|d’WN| > 0.7 (i.e. ”selective”), as used by Mooney et al. 2001, PNAS. This is proportion data [0,1], so we will use the binomial distribution for our models.

Interpreting binomial coefficients: https://data.library.virginia.edu/getting-started-with-binomial-generalized-linear-mixed-models/

#find values over |0.7|. Success = 1, failure = 0
dprime_zebi$dselective01<- with(dprime_zebi, ifelse(dprime > 0.7, 1, ifelse(dprime < -0.7, 1, 0)))
#Create separate dataframes for Field L and NCM
dprime_zebi_FL<-subset(dprime_zebi,Region=="FL")
dprime_zebi_NCM<-subset(dprime_zebi,Region=="NCM")
#quick plot to view data
ggplot(dprime_zebi,aes(x=dselective01))+geom_histogram(stat="count")

Most units are selective for songs over white noise. Let’s see how this is affected by treatment and the stimulus identity.

Field L

Model Creation

dprop0<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=dprime_zebi_FL,family=binomial)
summary(dprop0)

Random effects removed: age, days post fledge

dprop<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere)+(1|ID.x)+(1|Clutch),data=dprime_zebi_FL,family=binomial) 
dprop1<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+Mass+Hemisphere+(1|Unit2)+(1|ID.x)+(1|Clutch),data=dprime_zebi_FL,family=binomial) 
dprop2<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+Mass+(1|Unit2)+(1|Hemisphere)+(1|ID.x)+(1|Clutch),data=dprime_zebi_FL,family=binomial) 
dprop3<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|ID.x)+(1|Clutch),data=dprime_zebi_FL,family=binomial) 
dprop3x<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|ID.x),data=dprime_zebi_FL,family=binomial) 
AICtab(dprop,dprop1,dprop2,dprop3,dprop3x)

dprop3 is the best fit.

Model diagnostics

dprop3xFL<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|ID.x),data=dprime_zebi_FL,family=binomial) 
#diagnostics check (Dharma package)
simres <- simulateResiduals(dprop3xFL)
plot(simres) 

Looks great with no issues!

NOTE: The link scale for this model is logit. Original output will be on the log odds ratio scale. If converting to response scale, they will be in log odds.

Model Inference and Post Hoc Tests

summary(dprop3xFL)
##  Family: binomial  ( logit )
## Formula:          
## dselective01 ~ Treatment * FamUnfamSpecies + TypeFL + Hemisphere +  
##     (1 | Unit2) + (1 | ID.x)
## Data: dprime_zebi_FL
## 
##      AIC      BIC   logLik deviance df.resid 
##    675.6    733.4   -324.8    649.6      614 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.9323   0.9656  
##  ID.x   (Intercept) 0.5439   0.7375  
## Number of obs: 627, groups:  Unit2, 175; ID.x, 14
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                         0.1759     0.5294   0.332
## TreatmentIsolate                                    0.2990     0.8290   0.361
## Treatmentxfostered                                  1.3792     0.9959   1.385
## FamUnfamSpeciesUnfamiliar_BEFI                     -0.6660     0.4016  -1.658
## FamUnfamSpeciesUnfamiliar_ZEBI                     -0.2156     0.4649  -0.464
## TypeFLNarrow                                        0.5740     0.2934   1.956
## HemisphereR                                         1.3838     0.3347   4.135
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    -0.7563     0.6796  -1.113
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  -0.1549     0.9565  -0.162
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI     1.2622     0.8800   1.434
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  -1.3666     0.9697  -1.409
##                                                   Pr(>|z|)    
## (Intercept)                                         0.7397    
## TreatmentIsolate                                    0.7184    
## Treatmentxfostered                                  0.1661    
## FamUnfamSpeciesUnfamiliar_BEFI                      0.0973 .  
## FamUnfamSpeciesUnfamiliar_ZEBI                      0.6428    
## TypeFLNarrow                                        0.0504 .  
## HemisphereR                                       3.55e-05 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI     0.2658    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI   0.8714    
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI     0.1515    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI   0.1588    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plogis(1.384) #effect of hemisphere
## [1] 0.7996326
plogis(0.574) #effect of unit type
## [1] 0.6396856
emmeans(dprop3xFL,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     0.861 0.401 Inf    0.0744      1.65
##  Isolate    1.329 0.553 Inf    0.2444      2.41
##  xfostered  1.733 0.468 Inf    0.8157      2.65
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      -0.468 0.678 Inf  -0.689  0.7697
##  normal - xfostered    -0.872 0.607 Inf  -1.436  0.3225
##  Isolate - xfostered   -0.404 0.712 Inf  -0.568  0.8370
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(dprop3xFL,pairwise~Treatment,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment  prob     SE  df asymp.LCL asymp.UCL
##  normal    0.703 0.0838 Inf     0.519     0.839
##  Isolate   0.791 0.0916 Inf     0.561     0.918
##  xfostered 0.850 0.0597 Inf     0.693     0.934
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
##  contrast            odds.ratio    SE  df null z.ratio p.value
##  normal / Isolate         0.626 0.425 Inf    1  -0.689  0.7697
##  normal / xfostered       0.418 0.254 Inf    1  -1.436  0.3225
##  Isolate / xfostered      0.667 0.475 Inf    1  -0.568  0.8370
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale
emmeans(dprop3xFL,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     1.1548 0.495 Inf    0.1846      2.12
##  Unfamiliar_BEFI 0.4888 0.422 Inf   -0.3383      1.32
##  Unfamiliar_ZEBI 0.9392 0.487 Inf   -0.0153      1.89
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     1.4538 0.673 Inf    0.1347      2.77
##  Unfamiliar_BEFI 0.0314 0.554 Inf   -1.0537      1.12
##  Unfamiliar_ZEBI 2.5004 0.773 Inf    0.9849      4.02
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     2.5340 0.877 Inf    0.8142      4.25
##  Unfamiliar_BEFI 1.7131 0.492 Inf    0.7489      2.68
##  Unfamiliar_ZEBI 0.9518 0.436 Inf    0.0970      1.81
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.666 0.402 Inf   1.658  0.2215
##  Father_ZEBI - Unfamiliar_ZEBI        0.216 0.465 Inf   0.464  0.8882
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -0.450 0.392 Inf  -1.148  0.4847
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        1.422 0.554 Inf   2.567  0.0277
##  Father_ZEBI - Unfamiliar_ZEBI       -1.047 0.746 Inf  -1.402  0.3398
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -2.469 0.674 Inf  -3.664  0.0007
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.821 0.868 Inf   0.945  0.6115
##  Father_ZEBI - Unfamiliar_ZEBI        1.582 0.852 Inf   1.858  0.1511
##  Unfamiliar_BEFI - Unfamiliar_ZEBI    0.761 0.395 Inf   1.928  0.1309
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(dprop3xFL,pairwise~"FamUnfamSpecies","Treatment",type="response")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.760 0.0902 Inf     0.546     0.893
##  Unfamiliar_BEFI 0.620 0.0994 Inf     0.416     0.789
##  Unfamiliar_ZEBI 0.719 0.0984 Inf     0.496     0.869
## 
## Treatment = Isolate:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.811 0.1033 Inf     0.534     0.941
##  Unfamiliar_BEFI 0.508 0.1384 Inf     0.259     0.753
##  Unfamiliar_ZEBI 0.924 0.0542 Inf     0.728     0.982
## 
## Treatment = xfostered:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.926 0.0598 Inf     0.693     0.986
##  Unfamiliar_BEFI 0.847 0.0637 Inf     0.679     0.936
##  Unfamiliar_ZEBI 0.721 0.0876 Inf     0.524     0.859
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
## Treatment = normal:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI         1.9464 0.7817 Inf    1   1.658  0.2215
##  Father_ZEBI / Unfamiliar_ZEBI         1.2406 0.5767 Inf    1   0.464  0.8882
##  Unfamiliar_BEFI / Unfamiliar_ZEBI     0.6374 0.2501 Inf    1  -1.148  0.4847
## 
## Treatment = Isolate:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI         4.1468 2.2975 Inf    1   2.567  0.0277
##  Father_ZEBI / Unfamiliar_ZEBI         0.3511 0.2621 Inf    1  -1.402  0.3398
##  Unfamiliar_BEFI / Unfamiliar_ZEBI     0.0847 0.0571 Inf    1  -3.664  0.0007
## 
## Treatment = xfostered:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI         2.2724 1.9730 Inf    1   0.945  0.6115
##  Father_ZEBI / Unfamiliar_ZEBI         4.8653 4.1435 Inf    1   1.858  0.1511
##  Unfamiliar_BEFI / Unfamiliar_ZEBI     2.1410 0.8456 Inf    1   1.928  0.1309
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale
emmeans(dprop3xFL,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal    1.1548 0.495 Inf    0.1846      2.12
##  Isolate   1.4538 0.673 Inf    0.1347      2.77
##  xfostered 2.5340 0.877 Inf    0.8142      4.25
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal    0.4888 0.422 Inf   -0.3383      1.32
##  Isolate   0.0314 0.554 Inf   -1.0537      1.12
##  xfostered 1.7131 0.492 Inf    0.7489      2.68
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal    0.9392 0.487 Inf   -0.0153      1.89
##  Isolate   2.5004 0.773 Inf    0.9849      4.02
##  xfostered 0.9518 0.436 Inf    0.0970      1.81
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -0.2990 0.829 Inf  -0.361  0.9308
##  normal - xfostered   -1.3792 0.996 Inf  -1.385  0.3488
##  Isolate - xfostered  -1.0802 1.095 Inf  -0.986  0.5855
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      0.4574 0.696 Inf   0.657  0.7883
##  normal - xfostered   -1.2243 0.643 Inf  -1.904  0.1376
##  Isolate - xfostered  -1.6817 0.734 Inf  -2.291  0.0571
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     -1.5612 0.906 Inf  -1.723  0.1965
##  normal - xfostered   -0.0126 0.651 Inf  -0.019  0.9998
##  Isolate - xfostered   1.5486 0.877 Inf   1.765  0.1813
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates

NCM

Model Creation

dprop0<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass)+(1|DaysPostFledge)+(1|Age)+(1|Hemisphere)+(1|Clutch)+(1|ID.x),data=dprime_zebi_NCM,family=binomial)
summary(dprop0)

Random effects removed: mass, Clutch, age, days post fledge

dprop<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Hemisphere)+(1|ID.x),data=dprime_zebi_NCM,family=binomial) 
dprop1<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=dprime_zebi_NCM,family=binomial) 
AICtab(dprop0,dprop,dprop1)

dprop1 is the best fit by 3 deltaAIC.

Model diagnostics

dprop1NCM<-glmmTMB(dselective01~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|ID.x),data=dprime_zebi_NCM,family=binomial) 

#diagnostics check (Dharma package)
simres1 <- simulateResiduals(dprop1NCM)
plot(simres1) 

Diagnostics look great with no issues!

NOTE: The link scale for this model is logit. Original output will be on the log odds ratio scale. If converting to response scale, they will be in log odds.

Model Inference and Post Hoc Tests

summary(dprop1NCM)
##  Family: binomial  ( logit )
## Formula:          
## dselective01 ~ Treatment * FamUnfamSpecies + Type0 + Hemisphere +  
##     (1 | Unit2) + (1 | ID.x)
## Data: dprime_zebi_NCM
## 
##      AIC      BIC   logLik deviance df.resid 
##    542.9    602.7   -257.4    514.9      515 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.6319   0.7949  
##  ID.x   (Intercept) 0.5005   0.7075  
## Number of obs: 529, groups:  Unit2, 148; ID.x, 16
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                         3.0120     0.7392   4.075
## TreatmentIsolate                                   -2.7072     0.9946  -2.722
## Treatmentxfostered                                 -2.2661     1.0790  -2.100
## FamUnfamSpeciesUnfamiliar_BEFI                     -1.6683     0.6636  -2.514
## FamUnfamSpeciesUnfamiliar_ZEBI                     -1.4710     0.7171  -2.051
## Type0NS1                                            0.6078     0.4820   1.261
## Type0NS2                                            0.1614     0.3927   0.411
## HemisphereR                                         0.6073     0.3237   1.876
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI     1.1052     0.8843   1.250
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI   2.4543     1.0991   2.233
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI     1.0182     0.9838   1.035
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI   1.1543     1.0971   1.052
##                                                   Pr(>|z|)    
## (Intercept)                                       4.61e-05 ***
## TreatmentIsolate                                   0.00649 ** 
## Treatmentxfostered                                 0.03571 *  
## FamUnfamSpeciesUnfamiliar_BEFI                     0.01194 *  
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.04025 *  
## Type0NS1                                           0.20728    
## Type0NS2                                           0.68105    
## HemisphereR                                        0.06065 .  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.21139    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.02555 *  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.30068    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.29277    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plogis(0.6073) #effect of hemisphere, marginal P value
## [1] 0.6473246
emmeans(dprop1NCM,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.526 0.464 Inf     1.615      3.44
##  Isolate    0.526 0.575 Inf    -0.601      1.65
##  xfostered  1.462 0.446 Inf     0.588      2.34
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate       1.999 0.708 Inf   2.822  0.0132
##  normal - xfostered     1.063 0.604 Inf   1.760  0.1831
##  Isolate - xfostered   -0.936 0.682 Inf  -1.372  0.3557
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(dprop1NCM,pairwise~Treatment,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment  prob     SE  df asymp.LCL asymp.UCL
##  normal    0.926 0.0319 Inf     0.834     0.969
##  Isolate   0.629 0.1343 Inf     0.354     0.839
##  xfostered 0.812 0.0681 Inf     0.643     0.912
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
##  contrast            odds.ratio    SE  df null z.ratio p.value
##  normal / Isolate         7.384 5.232 Inf    1   2.822  0.0132
##  normal / xfostered       2.896 1.749 Inf    1   1.760  0.1831
##  Isolate / xfostered      0.392 0.268 Inf    1  -1.372  0.3557
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale
emmeans(dprop1NCM,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      3.572 0.735 Inf     2.131      5.01
##  Unfamiliar_BEFI  1.904 0.454 Inf     1.013      2.79
##  Unfamiliar_ZEBI  2.101 0.534 Inf     1.054      3.15
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      0.865 0.711 Inf    -0.528      2.26
##  Unfamiliar_BEFI  0.302 0.614 Inf    -0.901      1.50
##  Unfamiliar_ZEBI  0.412 0.699 Inf    -0.958      1.78
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      1.306 0.805 Inf    -0.272      2.88
##  Unfamiliar_BEFI  2.092 0.533 Inf     1.048      3.14
##  Unfamiliar_ZEBI  0.989 0.447 Inf     0.113      1.87
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        1.668 0.664 Inf   2.514  0.0320
##  Father_ZEBI - Unfamiliar_ZEBI        1.471 0.717 Inf   2.051  0.1002
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -0.197 0.448 Inf  -0.440  0.8988
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.563 0.588 Inf   0.957  0.6041
##  Father_ZEBI - Unfamiliar_ZEBI        0.453 0.676 Inf   0.670  0.7809
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -0.110 0.576 Inf  -0.192  0.9800
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       -0.786 0.864 Inf  -0.910  0.6340
##  Father_ZEBI - Unfamiliar_ZEBI        0.317 0.823 Inf   0.385  0.9216
##  Unfamiliar_BEFI - Unfamiliar_ZEBI    1.103 0.425 Inf   2.592  0.0258
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(dprop1NCM,pairwise~"FamUnfamSpecies","Treatment",type="response")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.973 0.0195 Inf     0.894     0.993
##  Unfamiliar_BEFI 0.870 0.0513 Inf     0.734     0.942
##  Unfamiliar_ZEBI 0.891 0.0519 Inf     0.742     0.959
## 
## Treatment = Isolate:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.704 0.1482 Inf     0.371     0.905
##  Unfamiliar_BEFI 0.575 0.1500 Inf     0.289     0.818
##  Unfamiliar_ZEBI 0.602 0.1675 Inf     0.277     0.856
## 
## Treatment = xfostered:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.787 0.1350 Inf     0.432     0.947
##  Unfamiliar_BEFI 0.890 0.0521 Inf     0.740     0.958
##  Unfamiliar_ZEBI 0.729 0.0884 Inf     0.528     0.866
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
## Treatment = normal:
##  contrast                          odds.ratio    SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          5.303 3.519 Inf    1   2.514  0.0320
##  Father_ZEBI / Unfamiliar_ZEBI          4.354 3.122 Inf    1   2.051  0.1002
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      0.821 0.368 Inf    1  -0.440  0.8988
## 
## Treatment = Isolate:
##  contrast                          odds.ratio    SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          1.756 1.033 Inf    1   0.957  0.6041
##  Father_ZEBI / Unfamiliar_ZEBI          1.573 1.063 Inf    1   0.670  0.7809
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      0.896 0.516 Inf    1  -0.192  0.9800
## 
## Treatment = xfostered:
##  contrast                          odds.ratio    SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          0.456 0.394 Inf    1  -0.910  0.6340
##  Father_ZEBI / Unfamiliar_ZEBI          1.373 1.129 Inf    1   0.385  0.9216
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      3.012 1.281 Inf    1   2.592  0.0258
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale
emmeans(dprop1NCM,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     3.572 0.735 Inf     2.131      5.01
##  Isolate    0.865 0.711 Inf    -0.528      2.26
##  xfostered  1.306 0.805 Inf    -0.272      2.88
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     1.904 0.454 Inf     1.013      2.79
##  Isolate    0.302 0.614 Inf    -0.901      1.50
##  xfostered  2.092 0.533 Inf     1.048      3.14
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.101 0.534 Inf     1.054      3.15
##  Isolate    0.412 0.699 Inf    -0.958      1.78
##  xfostered  0.989 0.447 Inf     0.113      1.87
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate       2.707 0.995 Inf   2.722  0.0178
##  normal - xfostered     2.266 1.079 Inf   2.100  0.0898
##  Isolate - xfostered   -0.441 1.049 Inf  -0.420  0.9072
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate       1.602 0.738 Inf   2.171  0.0763
##  normal - xfostered    -0.188 0.654 Inf  -0.288  0.9554
##  Isolate - xfostered   -1.790 0.770 Inf  -2.325  0.0524
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate       1.689 0.856 Inf   1.973  0.1188
##  normal - xfostered     1.112 0.659 Inf   1.688  0.2099
##  Isolate - xfostered   -0.577 0.788 Inf  -0.733  0.7440
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(dprop1NCM,pairwise~Type0)
## $emmeans
##  Type0 emmean    SE  df asymp.LCL asymp.UCL
##  Broad   1.25 0.291 Inf     0.679      1.82
##  NS1     1.86 0.515 Inf     0.847      2.87
##  NS2     1.41 0.442 Inf     0.543      2.28
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate    SE  df z.ratio p.value
##  Broad - NS1   -0.608 0.482 Inf  -1.261  0.4173
##  Broad - NS2   -0.161 0.393 Inf  -0.411  0.9111
##  NS1 - NS2      0.446 0.587 Inf   0.760  0.7274
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(dprop1NCM,pairwise~Type0,type="response")
## $emmeans
##  Type0  prob     SE  df asymp.LCL asymp.UCL
##  Broad 0.777 0.0503 Inf     0.663     0.860
##  NS1   0.865 0.0602 Inf     0.700     0.946
##  NS2   0.804 0.0698 Inf     0.632     0.907
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
##  contrast    odds.ratio    SE  df null z.ratio p.value
##  Broad / NS1      0.545 0.262 Inf    1  -1.261  0.4173
##  Broad / NS2      0.851 0.334 Inf    1  -0.411  0.9111
##  NS1 / NS2        1.563 0.918 Inf    1   0.760  0.7274
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale

PROPORTION RESPONSIVE

This is proportion data, so we will again model it with a binomial distribution.

#use the firezals_sum_zebi df, sigYN column
#create success/failure column that is 0 and 1 instead of Y and N 
firezals_sum_zebiFL$sigYN01<-with(firezals_sum_zebiFL,ifelse(sigYN == "Y",1,0))
firezals_sum_zebiNCM$sigYN01<-with(firezals_sum_zebiNCM,ifelse(sigYN == "Y",1,0))

#quick plot to view data
ggplot(firezals_sum_zebiNCM,aes(x=sigYN01))+geom_histogram(stat="count")+facet_wrap(~Treatment)

The proportion of responsive units certainly looks different across the treatments, but let’s see what happens when we incorporate stimulus type and random factors.

Field L

Model Creation

prop0<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Age)+(1|Hemisphere)+(1|Mass)+(1|DaysPostFledge)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiFL,family=binomial)
summary(prop0)

Random effects removed due to low variance: Clutch, Days post fledge, ID.x

prop1<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Hemisphere)+(1|Age)+(1|Mass),data=firezals_sum_zebiFL,family=binomial)
prop2<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Age)+(1|Mass),data=firezals_sum_zebiFL,family=binomial)
prop3<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+Mass+(1|Unit2)+(1|Age)+(1|Hemisphere),data=firezals_sum_zebiFL,family=binomial)
prop4<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+Age+(1|Unit2)+(1|Mass)+(1|Hemisphere),data=firezals_sum_zebiFL,family=binomial)
prop5<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+Mass+(1|Unit2)+(1|Age),data=firezals_sum_zebiFL,family=binomial)
prop6<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+Mass+Age+(1|Unit2),data=firezals_sum_zebiFL,family=binomial)
AICtab(prop0,prop1,prop2,prop3,prop4,prop5,prop6)

It seems like adding only Hemisphere as a predictor improves the fit of the model. prop2 is the best model fit (next lowest AIC is prop1 by 3.9 deltaAIC).

Model Diagnostics

prop2FL<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Age)+(1|Mass),data=firezals_sum_zebiFL,family=binomial)

simres <- simulateResiduals(prop2FL)
plot(simres) 

#plotResiduals(simres, form = firezals_sum_zebi$FamUnfamSpecies)
#plotResiduals(simres, form = firezals_sum_zebi$Treatment)

Diagnostics look great!

NOTE: The link scale for this model is logit. Original output will be on the log odds ratio scale. If converting to response scale, they will be in log odds.

Model Inference and Post Hoc Tests

summary(prop2FL)
##  Family: binomial  ( logit )
## Formula:          
## sigYN01 ~ Treatment * FamUnfamSpecies + TypeFL + Hemisphere +  
##     (1 | Unit2) + (1 | Age) + (1 | Mass)
## Data: firezals_sum_zebiFL
## 
##      AIC      BIC   logLik deviance df.resid 
##    705.9    785.9   -336.0    671.9      797 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.6945   0.8334  
##  Age    (Intercept) 0.2457   0.4957  
##  Mass   (Intercept) 1.6599   1.2884  
## Number of obs: 814, groups:  Unit2, 178; Age, 6; Mass, 12
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                        2.20790    0.78791   2.802
## TreatmentIsolate                                  -1.13521    0.89602  -1.267
## Treatmentxfostered                                -0.01026    1.25625  -0.008
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.50649    0.51792  -0.978
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.18319    0.60599  -0.302
## FamUnfamSpeciesWN_WN                              -2.63910    0.57149  -4.618
## TypeFLNarrow                                       0.89952    0.28841   3.119
## HemisphereR                                        0.91286    0.29483   3.096
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   -0.50573    0.83843  -0.603
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.07061    1.03148   0.068
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    1.03357    1.12969   0.915
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.81720    1.06105  -0.770
## TreatmentIsolate:FamUnfamSpeciesWN_WN             -0.35037    0.90808  -0.386
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -0.67282    1.03630  -0.649
##                                                   Pr(>|z|)    
## (Intercept)                                        0.00508 ** 
## TreatmentIsolate                                   0.20518    
## Treatmentxfostered                                 0.99348    
## FamUnfamSpeciesUnfamiliar_BEFI                     0.32811    
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.76243    
## FamUnfamSpeciesWN_WN                              3.88e-06 ***
## TypeFLNarrow                                       0.00182 ** 
## HemisphereR                                        0.00196 ** 
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.54639    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.94543    
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.36024    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.44119    
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.69962    
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.51618    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(0.9129 ) #effect of hemisphere
## [1] 2.491538
exp(0.8995) #effect of unit type
## [1] 2.458374
emmeans(prop2FL,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal      2.28 0.659 Inf     0.991      3.57
##  Isolate     1.19 0.716 Inf    -0.213      2.59
##  xfostered   1.92 0.743 Inf     0.460      3.37
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate       1.091 0.606 Inf   1.800  0.1696
##  normal - xfostered     0.365 0.902 Inf   0.405  0.9137
##  Isolate - xfostered   -0.726 1.026 Inf  -0.707  0.7593
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(prop2FL,pairwise~Treatment,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment  prob     SE  df asymp.LCL asymp.UCL
##  normal    0.907 0.0554 Inf     0.729     0.973
##  Isolate   0.767 0.1280 Inf     0.447     0.931
##  xfostered 0.872 0.0831 Inf     0.613     0.967
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
##  contrast            odds.ratio    SE  df null z.ratio p.value
##  normal / Isolate         2.977 1.804 Inf    1   1.800  0.1696
##  normal / xfostered       1.441 1.300 Inf    1   0.405  0.9137
##  Isolate / xfostered      0.484 0.497 Inf    1  -0.707  0.7593
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale
emmeans(prop2FL,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      3.114 0.781 Inf     1.583     4.645
##  Unfamiliar_BEFI  2.608 0.695 Inf     1.245     3.970
##  Unfamiliar_ZEBI  2.931 0.768 Inf     1.426     4.436
##  WN_WN            0.475 0.694 Inf    -0.886     1.836
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      1.979 0.883 Inf     0.247     3.710
##  Unfamiliar_BEFI  0.967 0.737 Inf    -0.478     2.411
##  Unfamiliar_ZEBI  2.829 1.020 Inf     0.830     4.828
##  WN_WN           -1.011 0.775 Inf    -2.529     0.508
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      3.104 1.079 Inf     0.989     5.218
##  Unfamiliar_BEFI  2.668 0.800 Inf     1.100     4.236
##  Unfamiliar_ZEBI  2.103 0.764 Inf     0.606     3.601
##  WN_WN           -0.208 0.750 Inf    -1.678     1.262
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.506 0.518 Inf   0.978  0.7621
##  Father_ZEBI - Unfamiliar_ZEBI        0.183 0.606 Inf   0.302  0.9904
##  Father_ZEBI - WN_WN                  2.639 0.571 Inf   4.618  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -0.323 0.500 Inf  -0.646  0.9169
##  Unfamiliar_BEFI - WN_WN              2.133 0.449 Inf   4.754  <.0001
##  Unfamiliar_ZEBI - WN_WN              2.456 0.553 Inf   4.439  0.0001
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        1.012 0.661 Inf   1.532  0.4179
##  Father_ZEBI - Unfamiliar_ZEBI       -0.850 0.953 Inf  -0.892  0.8090
##  Father_ZEBI - WN_WN                  2.989 0.729 Inf   4.099  0.0002
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -1.863 0.832 Inf  -2.239  0.1128
##  Unfamiliar_BEFI - WN_WN              1.977 0.530 Inf   3.730  0.0011
##  Unfamiliar_ZEBI - WN_WN              3.840 0.894 Inf   4.296  0.0001
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.436 0.891 Inf   0.489  0.9615
##  Father_ZEBI - Unfamiliar_ZEBI        1.000 0.871 Inf   1.149  0.6592
##  Father_ZEBI - WN_WN                  3.312 0.883 Inf   3.750  0.0010
##  Unfamiliar_BEFI - Unfamiliar_ZEBI    0.565 0.423 Inf   1.334  0.5409
##  Unfamiliar_BEFI - WN_WN              2.876 0.504 Inf   5.712  <.0001
##  Unfamiliar_ZEBI - WN_WN              2.312 0.438 Inf   5.281  <.0001
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(prop2FL,pairwise~"FamUnfamSpecies","Treatment",type="response")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.957 0.0318 Inf    0.8296     0.990
##  Unfamiliar_BEFI 0.931 0.0445 Inf    0.7764     0.981
##  Unfamiliar_ZEBI 0.949 0.0369 Inf    0.8063     0.988
##  WN_WN           0.617 0.1641 Inf    0.2920     0.862
## 
## Treatment = Isolate:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.879 0.0943 Inf    0.5615     0.976
##  Unfamiliar_BEFI 0.724 0.1471 Inf    0.3828     0.918
##  Unfamiliar_ZEBI 0.944 0.0537 Inf    0.6964     0.992
##  WN_WN           0.267 0.1516 Inf    0.0739     0.624
## 
## Treatment = xfostered:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.957 0.0443 Inf    0.7290     0.995
##  Unfamiliar_BEFI 0.935 0.0485 Inf    0.7502     0.986
##  Unfamiliar_ZEBI 0.891 0.0740 Inf    0.6471     0.973
##  WN_WN           0.448 0.1855 Inf    0.1574     0.779
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
## Treatment = normal:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          1.659  0.859 Inf    1   0.978  0.7621
##  Father_ZEBI / Unfamiliar_ZEBI          1.201  0.728 Inf    1   0.302  0.9904
##  Father_ZEBI / WN_WN                   14.001  8.001 Inf    1   4.618  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      0.724  0.362 Inf    1  -0.646  0.9169
##  Unfamiliar_BEFI / WN_WN                8.437  3.785 Inf    1   4.754  <.0001
##  Unfamiliar_ZEBI / WN_WN               11.657  6.450 Inf    1   4.439  0.0001
## 
## Treatment = Isolate:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          2.752  1.818 Inf    1   1.532  0.4179
##  Father_ZEBI / Unfamiliar_ZEBI          0.427  0.407 Inf    1  -0.892  0.8090
##  Father_ZEBI / WN_WN                   19.875 14.496 Inf    1   4.099  0.0002
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      0.155  0.129 Inf    1  -2.239  0.1128
##  Unfamiliar_BEFI / WN_WN                7.223  3.829 Inf    1   3.730  0.0011
##  Unfamiliar_ZEBI / WN_WN               46.519 41.579 Inf    1   4.296  0.0001
## 
## Treatment = xfostered:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          1.546  1.378 Inf    1   0.489  0.9615
##  Father_ZEBI / Unfamiliar_ZEBI          2.719  2.368 Inf    1   1.149  0.6592
##  Father_ZEBI / WN_WN                   27.438 24.229 Inf    1   3.750  0.0010
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      1.759  0.744 Inf    1   1.334  0.5409
##  Unfamiliar_BEFI / WN_WN               17.744  8.935 Inf    1   5.712  <.0001
##  Unfamiliar_ZEBI / WN_WN               10.090  4.417 Inf    1   5.281  <.0001
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 4 estimates 
## Tests are performed on the log odds ratio scale
emmeans(prop2FL,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     3.114 0.781 Inf     1.583     4.645
##  Isolate    1.979 0.883 Inf     0.247     3.710
##  xfostered  3.104 1.079 Inf     0.989     5.218
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.608 0.695 Inf     1.245     3.970
##  Isolate    0.967 0.737 Inf    -0.478     2.411
##  xfostered  2.668 0.800 Inf     1.100     4.236
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.931 0.768 Inf     1.426     4.436
##  Isolate    2.829 1.020 Inf     0.830     4.828
##  xfostered  2.103 0.764 Inf     0.606     3.601
## 
## FamUnfamSpecies = WN_WN:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     0.475 0.694 Inf    -0.886     1.836
##  Isolate   -1.011 0.775 Inf    -2.529     0.508
##  xfostered -0.208 0.750 Inf    -1.678     1.262
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      1.1352 0.896 Inf   1.267  0.4139
##  normal - xfostered    0.0103 1.256 Inf   0.008  1.0000
##  Isolate - xfostered  -1.1250 1.390 Inf  -0.810  0.6971
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      1.6409 0.672 Inf   2.440  0.0390
##  normal - xfostered   -0.0603 0.962 Inf  -0.063  0.9978
##  Isolate - xfostered  -1.7013 1.083 Inf  -1.571  0.2581
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      0.1016 1.017 Inf   0.100  0.9945
##  normal - xfostered    0.8275 0.990 Inf   0.836  0.6807
##  Isolate - xfostered   0.7258 1.270 Inf   0.572  0.8353
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      1.4856 0.706 Inf   2.104  0.0890
##  normal - xfostered    0.6831 0.958 Inf   0.713  0.7556
##  Isolate - xfostered  -0.8025 1.061 Inf  -0.757  0.7296
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates

NCM

Model Creation

prop0<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Age)+(1|Hemisphere)+(1|Mass)+(1|DaysPostFledge)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiNCM,family=binomial)
summary(prop0)

Random effects removed due to low variance: Clutch, Hemisphere, Mass, ID.x

prop1<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Age)+(1|DaysPostFledge),data=firezals_sum_zebiNCM,family=binomial)
prop2<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+Age+(1|Unit2)+(1|DaysPostFledge),data=firezals_sum_zebiNCM,family=binomial)
prop3<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+DaysPostFledge+(1|Unit2)+(1|Age),data=firezals_sum_zebiNCM,family=binomial)
prop4<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+DaysPostFledge+Age+(1|Unit2),data=firezals_sum_zebiNCM,family=binomial)
AICtab(prop0,prop1,prop2,prop3,prop4)

prop1 and prop3 are the best models, but are not significantly different from each other in terms of fit to the data. They also both have the same number of df. The inferences are slightly different, though, so I will see if one has better diagnostics than the other to help decide which to use.

Model Diagnostics

prop1NCM<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Age)+(1|DaysPostFledge),data=firezals_sum_zebiNCM,family=binomial)
prop3NCM<-glmmTMB(sigYN01~Treatment*FamUnfamSpecies+Type0+DaysPostFledge+(1|Unit2)+(1|Age),data=firezals_sum_zebiNCM,family=binomial)

simres1 <- simulateResiduals(prop3NCM)
plot(simres1) 

simres2 <- simulateResiduals(prop1NCM)
plot(simres2)

Diagnostics look great for prop3NCM and just OK for prop1NCM, so it looks like we have a winner.

NOTE: The link scale for this model is logit. Original output will be on the log odds ratio scale. If converting to response scale, they will be in log odds.

Model Inference and Post Hoc Tests

summary(prop3NCM)
##  Family: binomial  ( logit )
## Formula:          
## sigYN01 ~ Treatment * FamUnfamSpecies + Type0 + DaysPostFledge +  
##     (1 | Unit2) + (1 | Age)
## Data: firezals_sum_zebiNCM
## 
##      AIC      BIC   logLik deviance df.resid 
##    700.3    777.3   -333.1    666.3      668 
## 
## Random effects:
## 
## Conditional model:
##  Groups Name        Variance Std.Dev.
##  Unit2  (Intercept) 0.2705   0.5201  
##  Age    (Intercept) 0.3606   0.6005  
## Number of obs: 685, groups:  Unit2, 150; Age, 6
## 
## Conditional model:
##                                                   Estimate Std. Error z value
## (Intercept)                                        0.80516    0.70341   1.145
## TreatmentIsolate                                  -0.01941    0.79299  -0.024
## Treatmentxfostered                                -1.33545    0.76080  -1.755
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.67974    0.47667  -1.426
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.56411    0.53882  -1.047
## FamUnfamSpeciesWN_WN                              -3.71703    0.55553  -6.691
## Type0NS1                                           0.53030    0.35062   1.512
## Type0NS2                                          -0.12075    0.31778  -0.380
## DaysPostFledge                                     0.61965    0.19482   3.181
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.02145    0.87712   0.024
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  1.30354    0.85420   1.526
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.20431    1.00881   0.203
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.42263    0.85014  -0.497
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.89067    0.95800   0.930
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.63684    0.89292   0.713
##                                                   Pr(>|z|)    
## (Intercept)                                        0.25235    
## TreatmentIsolate                                   0.98047    
## Treatmentxfostered                                 0.07920 .  
## FamUnfamSpeciesUnfamiliar_BEFI                     0.15386    
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.29513    
## FamUnfamSpeciesWN_WN                              2.22e-11 ***
## Type0NS1                                           0.13042    
## Type0NS2                                           0.70396    
## DaysPostFledge                                     0.00147 ** 
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.98049    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.12700    
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.83951    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.61909    
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.35252    
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.47572    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(0.61965) #effect of days post fledge
## [1] 1.858278
emmeans(prop3NCM,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     1.440 0.346 Inf     0.761      2.12
##  Isolate    1.700 0.437 Inf     0.843      2.56
##  xfostered  0.484 0.362 Inf    -0.226      1.19
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate      -0.260 0.381 Inf  -0.681  0.7745
##  normal - xfostered     0.956 0.317 Inf   3.017  0.0072
##  Isolate - xfostered    1.216 0.410 Inf   2.963  0.0086
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(prop3NCM,pairwise~Treatment,type="response")
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment  prob     SE  df asymp.LCL asymp.UCL
##  normal    0.808 0.0536 Inf     0.682     0.893
##  Isolate   0.846 0.0571 Inf     0.699     0.928
##  xfostered 0.619 0.0854 Inf     0.444     0.767
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
##  contrast            odds.ratio    SE  df null z.ratio p.value
##  normal / Isolate         0.771 0.294 Inf    1  -0.681  0.7745
##  normal / xfostered       2.601 0.824 Inf    1   3.017  0.0072
##  Isolate / xfostered      3.373 1.384 Inf    1   2.963  0.0086
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale
emmeans(prop3NCM,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      2.680 0.524 Inf   1.65344     3.707
##  Unfamiliar_BEFI  2.001 0.393 Inf   1.23074     2.770
##  Unfamiliar_ZEBI  2.116 0.468 Inf   1.19974     3.033
##  WN_WN           -1.037 0.438 Inf  -1.89482    -0.179
## 
## Treatment = Isolate:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      2.661 0.733 Inf   1.22395     4.098
##  Unfamiliar_BEFI  2.003 0.515 Inf   0.99234     3.013
##  Unfamiliar_ZEBI  2.301 0.674 Inf   0.98066     3.622
##  WN_WN           -0.165 0.585 Inf  -1.31191     0.981
## 
## Treatment = xfostered:
##  FamUnfamSpecies emmean    SE  df asymp.LCL asymp.UCL
##  Father_ZEBI      1.345 0.682 Inf   0.00811     2.682
##  Unfamiliar_BEFI  1.969 0.474 Inf   1.03985     2.897
##  Unfamiliar_ZEBI  0.358 0.372 Inf  -0.37023     1.086
##  WN_WN           -1.735 0.467 Inf  -2.65127    -0.819
## 
## Results are averaged over the levels of: Type0 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.680 0.477 Inf   1.426  0.4830
##  Father_ZEBI - Unfamiliar_ZEBI        0.564 0.539 Inf   1.047  0.7218
##  Father_ZEBI - WN_WN                  3.717 0.556 Inf   6.691  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -0.116 0.419 Inf  -0.276  0.9927
##  Unfamiliar_BEFI - WN_WN              3.037 0.431 Inf   7.053  <.0001
##  Unfamiliar_ZEBI - WN_WN              3.153 0.500 Inf   6.301  <.0001
## 
## Treatment = Isolate:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI        0.658 0.737 Inf   0.893  0.8084
##  Father_ZEBI - Unfamiliar_ZEBI        0.360 0.853 Inf   0.422  0.9748
##  Father_ZEBI - WN_WN                  2.826 0.808 Inf   3.498  0.0026
##  Unfamiliar_BEFI - Unfamiliar_ZEBI   -0.298 0.680 Inf  -0.439  0.9717
##  Unfamiliar_BEFI - WN_WN              2.168 0.617 Inf   3.514  0.0025
##  Unfamiliar_ZEBI - WN_WN              2.467 0.754 Inf   3.270  0.0059
## 
## Treatment = xfostered:
##  contrast                          estimate    SE  df z.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI       -0.624 0.707 Inf  -0.883  0.8138
##  Father_ZEBI - Unfamiliar_ZEBI        0.987 0.657 Inf   1.501  0.4366
##  Father_ZEBI - WN_WN                  3.080 0.720 Inf   4.281  0.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI    1.611 0.414 Inf   3.888  0.0006
##  Unfamiliar_BEFI - WN_WN              3.704 0.533 Inf   6.955  <.0001
##  Unfamiliar_ZEBI - WN_WN              2.093 0.428 Inf   4.889  <.0001
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(prop3NCM,pairwise~"FamUnfamSpecies","Treatment",type="response")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.936 0.0315 Inf    0.8394     0.976
##  Unfamiliar_BEFI 0.881 0.0412 Inf    0.7739     0.941
##  Unfamiliar_ZEBI 0.892 0.0449 Inf    0.7685     0.954
##  WN_WN           0.262 0.0846 Inf    0.1307     0.455
## 
## Treatment = Isolate:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.935 0.0448 Inf    0.7728     0.984
##  Unfamiliar_BEFI 0.881 0.0540 Inf    0.7295     0.953
##  Unfamiliar_ZEBI 0.909 0.0557 Inf    0.7272     0.974
##  WN_WN           0.459 0.1452 Inf    0.2122     0.727
## 
## Treatment = xfostered:
##  FamUnfamSpecies  prob     SE  df asymp.LCL asymp.UCL
##  Father_ZEBI     0.793 0.1118 Inf    0.5020     0.936
##  Unfamiliar_BEFI 0.877 0.0510 Inf    0.7388     0.948
##  Unfamiliar_ZEBI 0.589 0.0900 Inf    0.4085     0.748
##  WN_WN           0.150 0.0596 Inf    0.0659     0.306
## 
## Results are averaged over the levels of: Type0 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
## Treatment = normal:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          1.973  0.941 Inf    1   1.426  0.4830
##  Father_ZEBI / Unfamiliar_ZEBI          1.758  0.947 Inf    1   1.047  0.7218
##  Father_ZEBI / WN_WN                   41.142 22.856 Inf    1   6.691  <.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      0.891  0.373 Inf    1  -0.276  0.9927
##  Unfamiliar_BEFI / WN_WN               20.849  8.978 Inf    1   7.053  <.0001
##  Unfamiliar_ZEBI / WN_WN               23.404 11.711 Inf    1   6.301  <.0001
## 
## Treatment = Isolate:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          1.931  1.423 Inf    1   0.893  0.8084
##  Father_ZEBI / Unfamiliar_ZEBI          1.433  1.223 Inf    1   0.422  0.9748
##  Father_ZEBI / WN_WN                   16.884 13.644 Inf    1   3.498  0.0026
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      0.742  0.505 Inf    1  -0.439  0.9717
##  Unfamiliar_BEFI / WN_WN                8.741  5.394 Inf    1   3.514  0.0025
##  Unfamiliar_ZEBI / WN_WN               11.782  8.888 Inf    1   3.270  0.0059
## 
## Treatment = xfostered:
##  contrast                          odds.ratio     SE  df null z.ratio p.value
##  Father_ZEBI / Unfamiliar_BEFI          0.536  0.379 Inf    1  -0.883  0.8138
##  Father_ZEBI / Unfamiliar_ZEBI          2.682  1.763 Inf    1   1.501  0.4366
##  Father_ZEBI / WN_WN                   21.763 15.660 Inf    1   4.281  0.0001
##  Unfamiliar_BEFI / Unfamiliar_ZEBI      5.006  2.074 Inf    1   3.888  0.0006
##  Unfamiliar_BEFI / WN_WN               40.609 21.627 Inf    1   6.955  <.0001
##  Unfamiliar_ZEBI / WN_WN                8.113  3.474 Inf    1   4.889  <.0001
## 
## Results are averaged over the levels of: Type0 
## P value adjustment: tukey method for comparing a family of 4 estimates 
## Tests are performed on the log odds ratio scale
emmeans(prop3NCM,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.680 0.524 Inf   1.65344     3.707
##  Isolate    2.661 0.733 Inf   1.22395     4.098
##  xfostered  1.345 0.682 Inf   0.00811     2.682
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.001 0.393 Inf   1.23074     2.770
##  Isolate    2.003 0.515 Inf   0.99234     3.013
##  xfostered  1.969 0.474 Inf   1.03985     2.897
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal     2.116 0.468 Inf   1.19974     3.033
##  Isolate    2.301 0.674 Inf   0.98066     3.622
##  xfostered  0.358 0.372 Inf  -0.37023     1.086
## 
## FamUnfamSpecies = WN_WN:
##  Treatment emmean    SE  df asymp.LCL asymp.UCL
##  normal    -1.037 0.438 Inf  -1.89482    -0.179
##  Isolate   -0.165 0.585 Inf  -1.31191     0.981
##  xfostered -1.735 0.467 Inf  -2.65127    -0.819
## 
## Results are averaged over the levels of: Type0 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate     0.01941 0.793 Inf   0.024  0.9997
##  normal - xfostered   1.33545 0.761 Inf   1.755  0.1849
##  Isolate - xfostered  1.31604 0.916 Inf   1.437  0.3217
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate    -0.00204 0.495 Inf  -0.004  1.0000
##  normal - xfostered   0.03191 0.451 Inf   0.071  0.9972
##  Isolate - xfostered  0.03395 0.560 Inf   0.061  0.9980
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate    -0.18490 0.704 Inf  -0.263  0.9627
##  normal - xfostered   1.75809 0.447 Inf   3.930  0.0003
##  Isolate - xfostered  1.94299 0.662 Inf   2.937  0.0093
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate    SE  df z.ratio p.value
##  normal - Isolate    -0.87126 0.614 Inf  -1.419  0.3312
##  normal - xfostered   0.69861 0.524 Inf   1.333  0.3766
##  Isolate - xfostered  1.56988 0.652 Inf   2.408  0.0424
## 
## Results are averaged over the levels of: Type0 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(prop3NCM,pairwise~Type0)
## $emmeans
##  Type0 emmean    SE  df asymp.LCL asymp.UCL
##  Broad  1.071 0.309 Inf     0.466      1.68
##  NS1    1.602 0.428 Inf     0.763      2.44
##  NS2    0.951 0.408 Inf     0.150      1.75
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## Results are given on the logit (not the response) scale. 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate    SE  df z.ratio p.value
##  Broad - NS1   -0.530 0.351 Inf  -1.512  0.2850
##  Broad - NS2    0.121 0.318 Inf   0.380  0.9235
##  NS1 - NS2      0.651 0.446 Inf   1.461  0.3097
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## Results are given on the log odds ratio (not the response) scale. 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(prop3NCM,pairwise~Type0,type="response")
## $emmeans
##  Type0  prob     SE  df asymp.LCL asymp.UCL
##  Broad 0.745 0.0587 Inf     0.614     0.842
##  NS1   0.832 0.0597 Inf     0.682     0.920
##  NS2   0.721 0.0821 Inf     0.538     0.852
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## 
## $contrasts
##  contrast    odds.ratio    SE  df null z.ratio p.value
##  Broad / NS1      0.588 0.206 Inf    1  -1.512  0.2850
##  Broad / NS2      1.128 0.359 Inf    1   0.380  0.9235
##  NS1 / NS2        1.918 0.854 Inf    1   1.461  0.3097
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## Tests are performed on the log odds ratio scale

ACCURACY

The rcorr values have been normalized so that 0 is now “random chance.” These data are continuous and bounded between [-1,1]. The data is right-skewed. Possible methods of modeling this data: gaussian or tweedie.

Field L

Model Creation

Try gaussian and tweedie.

accgau<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Age)+(1|Hemisphere)+(1|Mass)+(1|DaysPostFledge)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiFL_PC)
acctweed<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Age)+(1|Hemisphere)+(1|Mass)+(1|DaysPostFledge)+(1|Clutch)+(1|ID.x),family=tweedie,data=firezals_sum_zebiFL_PC)
AICtab(accgau,acctweed)

The gaussian distribution fits the data best by far. Let’s experiment with model specification.

Random effects removed due to low variance: Age, DaysPostFledge, Clutch, and ID.x (maybe hemisphere and mass)

accgau1<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2),data=firezals_sum_zebiFL_PC)
accgau2<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+(1|Unit2)+(1|Mass)+(1|Hemisphere),data=firezals_sum_zebiFL_PC)
accgau3<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Mass+(1|Unit2)+(1|Hemisphere),data=firezals_sum_zebiFL_PC)
accgau4<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiFL_PC)
accgau4x<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2),data=firezals_sum_zebiFL_PC)
accgau4disp<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~1,data=firezals_sum_zebiFL_PC)
accgau4disp1<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies,data=firezals_sum_zebiFL_PC)
accgau4disp2<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies+TypeFL,data=firezals_sum_zebiFL_PC)
accgau4disp3<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies+TypeFL+Hemisphere,data=firezals_sum_zebiFL_PC)

AICtab(accgau,accgau1,accgau2,accgau3,accgau4,accgau4disp,accgau4disp1,accgau4disp2,accgau4disp3,accgau4x)

It looks like adding Hemisphere, but not Mass, as a predictor improves the fit. Let’s check diagnostics. accgau4disp2 is best fitting model.

Model Diagnostics

accgau4disp2<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies+TypeFL,data=firezals_sum_zebiFL_PC)

#diagnostics check (Dharma package)
simres <- simulateResiduals(accgau4disp2)
plot(simres) 

testOutliers(simres,type='bootstrap')  #ns

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 13, observations = 748, p-value = 0.44
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.002673797 0.026102941
## sample estimates:
## outlier frequency (expected: 0.012379679144385 ) 
##                                       0.01737968

The KS test is significant and there are quantile deviations. After adding a dispersion parameter, this improved the model fit and the diagnostics. Let’s also check effectiveness of removing outliers.

firezals_sum_zebiFL_PC_outliersremoved<-cbind(firezals_sum_zebiFL_PC,simres$scaledResiduals) #scaled residuals based on accgau4disp2 model
colnames(firezals_sum_zebiFL_PC_outliersremoved)[50]<-'scaledResiduals'
firezals_sum_zebiFL_PC_outliersremoved<-subset(firezals_sum_zebiFL_PC_outliersremoved,scaledResiduals>0 & scaledResiduals<1)
accgau4disp2FL_nooutliers<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+TypeFL+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies+TypeFL,data=firezals_sum_zebiFL_PC_outliersremoved)

AICtab(accgau4disp2FL_nooutliers,accgau4disp2)
##                           dAIC df
## accgau4disp2FL_nooutliers  0.0 29
## accgau4disp2              94.6 29
simres1 <- simulateResiduals(accgau4disp2FL_nooutliers)
plot(simres1)

Removing outliers improves the model fit and diagnostics. Moving to inference with accgau4disp2FL_nooutliers.

NOTE: There is no link function for this model. The estimates are already on the response scale.

Model Inference and Post Hoc Tests

summary(accgau4disp2FL_nooutliers)
##  Family: gaussian  ( identity )
## Formula:          
## normal_rcorr ~ Treatment * FamUnfamSpecies + TypeFL + Hemisphere +  
##     (1 | Unit2) + (1 | Mass)
## Dispersion:                    ~Treatment * FamUnfamSpecies + TypeFL
## Data: firezals_sum_zebiFL_PC_outliersremoved
## 
##      AIC      BIC   logLik deviance df.resid 
##  -1162.4  -1029.0    610.2  -1220.4      706 
## 
## Random effects:
## 
## Conditional model:
##  Groups   Name        Variance Std.Dev.
##  Unit2    (Intercept) 0.001872 0.04326 
##  Mass     (Intercept) 0.002224 0.04715 
##  Residual                   NA      NA 
## Number of obs: 735, groups:  Unit2, 163; Mass, 12
## 
## Conditional model:
##                                                    Estimate Std. Error z value
## (Intercept)                                        0.112328   0.023448   4.790
## TreatmentIsolate                                  -0.049279   0.023005  -2.142
## Treatmentxfostered                                 0.058705   0.044861   1.309
## FamUnfamSpeciesUnfamiliar_BEFI                    -0.022789   0.014603  -1.561
## FamUnfamSpeciesUnfamiliar_ZEBI                    -0.004143   0.015228  -0.272
## FamUnfamSpeciesWN_WN                              -0.167428   0.015542 -10.773
## TypeFLNarrow                                       0.029225   0.010953   2.668
## HemisphereR                                        0.067817   0.011852   5.722
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.074226   0.022630   3.280
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.054543   0.038383   1.421
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.054819   0.026394   2.077
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.026574   0.037817  -0.703
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.073585   0.024153   3.047
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -0.070136   0.037419  -1.874
##                                                   Pr(>|z|)    
## (Intercept)                                       1.66e-06 ***
## TreatmentIsolate                                   0.03218 *  
## Treatmentxfostered                                 0.19067    
## FamUnfamSpeciesUnfamiliar_BEFI                     0.11863    
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.78555    
## FamUnfamSpeciesWN_WN                               < 2e-16 ***
## TypeFLNarrow                                       0.00763 ** 
## HemisphereR                                       1.05e-08 ***
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.00104 ** 
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.15532    
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.03780 *  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.48225    
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.00231 ** 
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.06088 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Dispersion model:
##                                                   Estimate Std. Error z value
## (Intercept)                                       -5.16359    0.23217 -22.241
## TreatmentIsolate                                   0.08298    0.35442   0.234
## Treatmentxfostered                                 1.30913    0.38213   3.426
## FamUnfamSpeciesUnfamiliar_BEFI                     0.58858    0.26795   2.197
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.07601    0.30946   0.246
## FamUnfamSpeciesWN_WN                               0.11067    0.36367   0.304
## TypeFLNarrow                                       0.24241    0.13254   1.829
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   -0.68608    0.41683  -1.646
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI -0.98382    0.43418  -2.266
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.16879    0.48441   0.348
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI -0.69625    0.45230  -1.539
## TreatmentIsolate:FamUnfamSpeciesWN_WN             -0.52151    0.53165  -0.981
## Treatmentxfostered:FamUnfamSpeciesWN_WN           -1.30584    0.53684  -2.432
##                                                   Pr(>|z|)    
## (Intercept)                                        < 2e-16 ***
## TreatmentIsolate                                  0.814888    
## Treatmentxfostered                                0.000613 ***
## FamUnfamSpeciesUnfamiliar_BEFI                    0.028047 *  
## FamUnfamSpeciesUnfamiliar_ZEBI                    0.805979    
## FamUnfamSpeciesWN_WN                              0.760889    
## TypeFLNarrow                                      0.067408 .  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   0.099774 .  
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI 0.023455 *  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   0.727504    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI 0.123723    
## TreatmentIsolate:FamUnfamSpeciesWN_WN             0.326632    
## Treatmentxfostered:FamUnfamSpeciesWN_WN           0.014996 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(accgau4disp2FL_nooutliers,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean     SE  df lower.CL upper.CL
##  normal     0.112 0.0206 706   0.0719    0.153
##  Isolate    0.114 0.0226 706   0.0692    0.158
##  xfostered  0.160 0.0239 706   0.1135    0.207
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate    -0.00138 0.0168 706  -0.082  0.9963
##  normal - xfostered  -0.04816 0.0316 706  -1.525  0.2799
##  Isolate - xfostered -0.04678 0.0328 706  -1.426  0.3282
## 
## Results are averaged over the levels of: FamUnfamSpecies, TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(accgau4disp2FL_nooutliers,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies   emmean     SE  df lower.CL upper.CL
##  Father_ZEBI      0.16085 0.0225 706   0.1167   0.2050
##  Unfamiliar_BEFI  0.13806 0.0222 706   0.0945   0.1817
##  Unfamiliar_ZEBI  0.15671 0.0226 706   0.1123   0.2011
##  WN_WN           -0.00658 0.0229 706  -0.0516   0.0385
## 
## Treatment = Isolate:
##  FamUnfamSpecies   emmean     SE  df lower.CL upper.CL
##  Father_ZEBI      0.11157 0.0260 706   0.0606   0.1626
##  Unfamiliar_BEFI  0.16301 0.0237 706   0.1165   0.2095
##  Unfamiliar_ZEBI  0.16225 0.0270 706   0.1093   0.2152
##  WN_WN            0.01773 0.0246 706  -0.0306   0.0660
## 
## Treatment = xfostered:
##  FamUnfamSpecies   emmean     SE  df lower.CL upper.CL
##  Father_ZEBI      0.21955 0.0388 706   0.1434   0.2957
##  Unfamiliar_BEFI  0.25131 0.0266 706   0.1991   0.3035
##  Unfamiliar_ZEBI  0.18884 0.0248 706   0.1402   0.2375
##  WN_WN           -0.01801 0.0243 706  -0.0658   0.0298
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                           estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI      0.022789 0.0146 706   1.561  0.4020
##  Father_ZEBI - Unfamiliar_ZEBI      0.004143 0.0152 706   0.272  0.9930
##  Father_ZEBI - WN_WN                0.167428 0.0155 706  10.773  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.018646 0.0148 706  -1.263  0.5871
##  Unfamiliar_BEFI - WN_WN            0.144638 0.0151 706   9.557  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.163284 0.0157 706  10.373  <.0001
## 
## Treatment = Isolate:
##  contrast                           estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.051437 0.0172 706  -2.983  0.0156
##  Father_ZEBI - Unfamiliar_ZEBI     -0.050675 0.0215 706  -2.356  0.0868
##  Father_ZEBI - WN_WN                0.093843 0.0185 706   5.075  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.000761 0.0186 706   0.041  1.0000
##  Unfamiliar_BEFI - WN_WN            0.145280 0.0151 706   9.622  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.144518 0.0198 706   7.300  <.0001
## 
## Treatment = xfostered:
##  contrast                           estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.031754 0.0356 706  -0.893  0.8086
##  Father_ZEBI - Unfamiliar_ZEBI      0.030717 0.0347 706   0.886  0.8120
##  Father_ZEBI - WN_WN                0.237563 0.0340 706   6.979  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.062471 0.0187 706   3.342  0.0048
##  Unfamiliar_BEFI - WN_WN            0.269317 0.0184 706  14.654  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.206846 0.0154 706  13.451  <.0001
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(accgau4disp2FL_nooutliers,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment   emmean     SE  df lower.CL upper.CL
##  normal     0.16085 0.0225 706   0.1167   0.2050
##  Isolate    0.11157 0.0260 706   0.0606   0.1626
##  xfostered  0.21955 0.0388 706   0.1434   0.2957
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment   emmean     SE  df lower.CL upper.CL
##  normal     0.13806 0.0222 706   0.0945   0.1817
##  Isolate    0.16301 0.0237 706   0.1165   0.2095
##  xfostered  0.25131 0.0266 706   0.1991   0.3035
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment   emmean     SE  df lower.CL upper.CL
##  normal     0.15671 0.0226 706   0.1123   0.2011
##  Isolate    0.16225 0.0270 706   0.1093   0.2152
##  xfostered  0.18884 0.0248 706   0.1402   0.2375
## 
## FamUnfamSpecies = WN_WN:
##  Treatment   emmean     SE  df lower.CL upper.CL
##  normal    -0.00658 0.0229 706  -0.0516   0.0385
##  Isolate    0.01773 0.0246 706  -0.0306   0.0660
##  xfostered -0.01801 0.0243 706  -0.0658   0.0298
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate     0.04928 0.0230 706   2.142  0.0822
##  normal - xfostered  -0.05870 0.0449 706  -1.309  0.3908
##  Isolate - xfostered -0.10798 0.0466 706  -2.316  0.0542
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate    -0.02495 0.0201 706  -1.241  0.4292
##  normal - xfostered  -0.11325 0.0347 706  -3.260  0.0033
##  Isolate - xfostered -0.08830 0.0355 706  -2.486  0.0351
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate    -0.00554 0.0243 706  -0.228  0.9717
##  normal - xfostered  -0.03213 0.0336 706  -0.955  0.6054
##  Isolate - xfostered -0.02659 0.0366 706  -0.727  0.7473
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate    -0.02431 0.0218 706  -1.117  0.5038
##  normal - xfostered   0.01143 0.0335 706   0.341  0.9379
##  Isolate - xfostered  0.03574 0.0346 706   1.034  0.5556
## 
## Results are averaged over the levels of: TypeFL, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates

NCM

Model Creation

Try gaussian and tweedie.

accgau<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Age)+(1|Hemisphere)+(1|Mass)+(1|DaysPostFledge)+(1|Clutch)+(1|ID.x),data=firezals_sum_zebiNCM_PC)
acctweed<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Age)+(1|Hemisphere)+(1|Mass)+(1|DaysPostFledge)+(1|Clutch)+(1|ID.x),family=tweedie,data=firezals_sum_zebiNCM_PC)
AICtab(accgau,acctweed)

The gaussian distribution fits the data best by far. Let’s experiment with model specification.

Random effects removed due to low variance: Age, Hemisphere, DaysPostFledge, Clutch, and ID.x

Mass is also low variance, so will experiment with keeping versus excluding.

accgau0<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+(1|Unit2)+(1|Mass),data=firezals_sum_zebiNCM_PC)
accgau1<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiNCM_PC)
accgau1a<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|Mass),dispformula = ~Treatment*FamUnfamSpecies,data=firezals_sum_zebiNCM_PC)
accgau2<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2),data=firezals_sum_zebiNCM_PC)
accgau3<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+Hemisphere+Mass+(1|Unit2),data=firezals_sum_zebiNCM_PC)
AICtab(accgau0,accgau1a,accgau1,accgau2,accgau3)

accgau1 best fit by 1.4 deltaAIC.

Model Diagnostics

accgau1NCM<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiNCM_PC)
#diagnostics check (Dharma package)
simres <- simulateResiduals(accgau1NCM)
plot(simres) 

testOutliers(simres,type='bootstrap') #NS

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres
## outliers at both margin(s) = 11, observations = 602, p-value = 0.34
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.004983389 0.025789037
## sample estimates:
## outlier frequency (expected: 0.0124916943521595 ) 
##                                        0.01827243

The KS test is significant and there are quantile deviations. After bootstrapping, the outlier test is not significant. Including a dispersion parameter did not improve the model fit.

firezals_sum_zebiNCM_PC_outliersremoved<-cbind(firezals_sum_zebiNCM_PC,simres$scaledResiduals) #scaled residuals based on accgau1NCM model
colnames(firezals_sum_zebiNCM_PC_outliersremoved)[50]<-'scaledResiduals'
firezals_sum_zebiNCM_PC_outliersremoved<-subset(firezals_sum_zebiNCM_PC_outliersremoved,scaledResiduals>0 & scaledResiduals<1)
accgau1NCM_nooutliers<-glmmTMB(normal_rcorr~Treatment*FamUnfamSpecies+Type0+Hemisphere+(1|Unit2)+(1|Mass),data=firezals_sum_zebiNCM_PC_outliersremoved)
AICtab(accgau1NCM,accgau1NCM_nooutliers)
##                       dAIC df
## accgau1NCM_nooutliers  0.0 18
## accgau1NCM            67.1 18
plot(simres)

simres2 <- simulateResiduals(accgau1NCM_nooutliers)
plot(simres2)

testOutliers(simres2,type='bootstrap') #NS

## 
##  DHARMa bootstrapped outlier test
## 
## data:  simres2
## outliers at both margin(s) = 5, observations = 591, p-value = 0.5
## alternative hypothesis: two.sided
##  percent confidence interval:
##  0.004187817 0.021996616
## sample estimates:
## outlier frequency (expected: 0.0127749576988156 ) 
##                                       0.008460237
plotResiduals(simres, form = firezals_sum_zebiNCM_PC$Treatment)

plotResiduals(simres2, form = firezals_sum_zebiNCM_PC_outliersremoved$Treatment)

Removing outliers slightly improves diagnostics and significantly improves model fit, so I will move forward with the model without outliers: accgau1NCM_nooutliers.

NOTE: There is no link function for this model. The estimates are already on the response scale.

Model Inference and Post Hoc Tests

summary(accgau1NCM_nooutliers)
##  Family: gaussian  ( identity )
## Formula:          
## normal_rcorr ~ Treatment * FamUnfamSpecies + Type0 + Hemisphere +  
##     (1 | Unit2) + (1 | Mass)
## Data: firezals_sum_zebiNCM_PC_outliersremoved
## 
##      AIC      BIC   logLik deviance df.resid 
##   -894.2   -815.4    465.1   -930.2      573 
## 
## Random effects:
## 
## Conditional model:
##  Groups   Name        Variance  Std.Dev.
##  Unit2    (Intercept) 0.0021995 0.04690 
##  Mass     (Intercept) 0.0008677 0.02946 
##  Residual             0.0102384 0.10119 
## Number of obs: 591, groups:  Unit2, 132; Mass, 12
## 
## Dispersion estimate for gaussian family (sigma^2): 0.0102 
## 
## Conditional model:
##                                                    Estimate Std. Error z value
## (Intercept)                                        0.160771   0.020729   7.756
## TreatmentIsolate                                  -0.121880   0.032890  -3.706
## Treatmentxfostered                                -0.114451   0.035870  -3.191
## FamUnfamSpeciesUnfamiliar_BEFI                     0.005271   0.016580   0.318
## FamUnfamSpeciesUnfamiliar_ZEBI                     0.018787   0.019049   0.986
## FamUnfamSpeciesWN_WN                              -0.193698   0.019248 -10.063
## Type0NS1                                           0.030531   0.017729   1.722
## Type0NS2                                           0.043427   0.017263   2.516
## HemisphereR                                        0.031158   0.013720   2.271
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI    0.052087   0.033587   1.551
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI  0.088669   0.035540   2.495
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI    0.021564   0.039218   0.550
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI  0.029612   0.036243   0.817
## TreatmentIsolate:FamUnfamSpeciesWN_WN              0.128481   0.038834   3.308
## Treatmentxfostered:FamUnfamSpeciesWN_WN            0.092535   0.036728   2.519
##                                                   Pr(>|z|)    
## (Intercept)                                       8.78e-15 ***
## TreatmentIsolate                                  0.000211 ***
## Treatmentxfostered                                0.001419 ** 
## FamUnfamSpeciesUnfamiliar_BEFI                    0.750535    
## FamUnfamSpeciesUnfamiliar_ZEBI                    0.324033    
## FamUnfamSpeciesWN_WN                               < 2e-16 ***
## Type0NS1                                          0.085048 .  
## Type0NS2                                          0.011884 *  
## HemisphereR                                       0.023151 *  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_BEFI   0.120952    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_BEFI 0.012600 *  
## TreatmentIsolate:FamUnfamSpeciesUnfamiliar_ZEBI   0.582419    
## Treatmentxfostered:FamUnfamSpeciesUnfamiliar_ZEBI 0.413906    
## TreatmentIsolate:FamUnfamSpeciesWN_WN             0.000938 ***
## Treatmentxfostered:FamUnfamSpeciesWN_WN           0.011753 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(accgau1NCM_nooutliers,pairwise~Treatment)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Treatment emmean     SE  df lower.CL upper.CL
##  normal    0.1586 0.0159 573   0.1274    0.190
##  Isolate   0.0872 0.0232 573   0.0417    0.133
##  xfostered 0.0968 0.0167 573   0.0641    0.130
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate      0.0713 0.0223 573   3.203  0.0041
##  normal - xfostered    0.0617 0.0202 573   3.056  0.0066
##  Isolate - xfostered  -0.0096 0.0251 573  -0.383  0.9223
## 
## Results are averaged over the levels of: FamUnfamSpecies, Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(accgau1NCM_nooutliers,pairwise~"FamUnfamSpecies","Treatment")
## $emmeans
## Treatment = normal:
##  FamUnfamSpecies  emmean     SE  df lower.CL upper.CL
##  Father_ZEBI      0.2010 0.0199 573   0.1620   0.2400
##  Unfamiliar_BEFI  0.2063 0.0175 573   0.1720   0.2406
##  Unfamiliar_ZEBI  0.2198 0.0198 573   0.1809   0.2587
##  WN_WN            0.0073 0.0200 573  -0.0320   0.0466
## 
## Treatment = Isolate:
##  FamUnfamSpecies  emmean     SE  df lower.CL upper.CL
##  Father_ZEBI      0.0791 0.0313 573   0.0176   0.1406
##  Unfamiliar_BEFI  0.1365 0.0264 573   0.0847   0.1883
##  Unfamiliar_ZEBI  0.1195 0.0318 573   0.0570   0.1819
##  WN_WN            0.0139 0.0313 573  -0.0476   0.0754
## 
## Treatment = xfostered:
##  FamUnfamSpecies  emmean     SE  df lower.CL upper.CL
##  Father_ZEBI      0.0866 0.0314 573   0.0248   0.1483
##  Unfamiliar_BEFI  0.1805 0.0198 573   0.1416   0.2194
##  Unfamiliar_ZEBI  0.1350 0.0178 573   0.0999   0.1700
##  WN_WN           -0.0146 0.0196 573  -0.0531   0.0239
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## Treatment = normal:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.00527 0.0166 573  -0.318  0.9889
##  Father_ZEBI - Unfamiliar_ZEBI     -0.01879 0.0190 573  -0.986  0.7574
##  Father_ZEBI - WN_WN                0.19370 0.0192 573  10.063  <.0001
##  Unfamiliar_BEFI - Unfamiliar_ZEBI -0.01352 0.0165 573  -0.821  0.8448
##  Unfamiliar_BEFI - WN_WN            0.19897 0.0167 573  11.916  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.21248 0.0192 573  11.096  <.0001
## 
## Treatment = Isolate:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.05736 0.0292 573  -1.964  0.2031
##  Father_ZEBI - Unfamiliar_ZEBI     -0.04035 0.0343 573  -1.177  0.6416
##  Father_ZEBI - WN_WN                0.06522 0.0337 573   1.934  0.2151
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.01701 0.0298 573   0.570  0.9410
##  Unfamiliar_BEFI - WN_WN            0.12258 0.0292 573   4.196  0.0002
##  Unfamiliar_ZEBI - WN_WN            0.10557 0.0343 573   3.080  0.0116
## 
## Treatment = xfostered:
##  contrast                          estimate     SE  df t.ratio p.value
##  Father_ZEBI - Unfamiliar_BEFI     -0.09394 0.0314 573  -2.988  0.0155
##  Father_ZEBI - Unfamiliar_ZEBI     -0.04840 0.0308 573  -1.570  0.3967
##  Father_ZEBI - WN_WN                0.10116 0.0313 573   3.234  0.0070
##  Unfamiliar_BEFI - Unfamiliar_ZEBI  0.04554 0.0173 573   2.634  0.0430
##  Unfamiliar_BEFI - WN_WN            0.19510 0.0192 573  10.173  <.0001
##  Unfamiliar_ZEBI - WN_WN            0.14956 0.0171 573   8.758  <.0001
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 4 estimates
emmeans(accgau1NCM_nooutliers,pairwise~"Treatment","FamUnfamSpecies")
## $emmeans
## FamUnfamSpecies = Father_ZEBI:
##  Treatment  emmean     SE  df lower.CL upper.CL
##  normal     0.2010 0.0199 573   0.1620   0.2400
##  Isolate    0.0791 0.0313 573   0.0176   0.1406
##  xfostered  0.0866 0.0314 573   0.0248   0.1483
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  Treatment  emmean     SE  df lower.CL upper.CL
##  normal     0.2063 0.0175 573   0.1720   0.2406
##  Isolate    0.1365 0.0264 573   0.0847   0.1883
##  xfostered  0.1805 0.0198 573   0.1416   0.2194
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  Treatment  emmean     SE  df lower.CL upper.CL
##  normal     0.2198 0.0198 573   0.1809   0.2587
##  Isolate    0.1195 0.0318 573   0.0570   0.1819
##  xfostered  0.1350 0.0178 573   0.0999   0.1700
## 
## FamUnfamSpecies = WN_WN:
##  Treatment  emmean     SE  df lower.CL upper.CL
##  normal     0.0073 0.0200 573  -0.0320   0.0466
##  Isolate    0.0139 0.0313 573  -0.0476   0.0754
##  xfostered -0.0146 0.0196 573  -0.0531   0.0239
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
## FamUnfamSpecies = Father_ZEBI:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate     0.12188 0.0329 573   3.706  0.0007
##  normal - xfostered   0.11445 0.0359 573   3.191  0.0043
##  Isolate - xfostered -0.00743 0.0423 573  -0.176  0.9831
## 
## FamUnfamSpecies = Unfamiliar_BEFI:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate     0.06979 0.0266 573   2.619  0.0245
##  normal - xfostered   0.02578 0.0238 573   1.084  0.5243
##  Isolate - xfostered -0.04401 0.0300 573  -1.469  0.3066
## 
## FamUnfamSpecies = Unfamiliar_ZEBI:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate     0.10032 0.0333 573   3.010  0.0077
##  normal - xfostered   0.08484 0.0240 573   3.536  0.0013
##  Isolate - xfostered -0.01548 0.0338 573  -0.458  0.8908
## 
## FamUnfamSpecies = WN_WN:
##  contrast            estimate     SE  df t.ratio p.value
##  normal - Isolate    -0.00660 0.0329 573  -0.200  0.9781
##  normal - xfostered   0.02192 0.0256 573   0.856  0.6684
##  Isolate - xfostered  0.02852 0.0343 573   0.832  0.6834
## 
## Results are averaged over the levels of: Type0, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(accgau1NCM_nooutliers,pairwise~Type0)
## $emmeans
##  Type0 emmean     SE  df lower.CL upper.CL
##  Broad 0.0896 0.0126 573   0.0649    0.114
##  NS1   0.1201 0.0199 573   0.0810    0.159
##  NS2   0.1330 0.0195 573   0.0947    0.171
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast    estimate     SE  df t.ratio p.value
##  Broad - NS1  -0.0305 0.0177 573  -1.722  0.1978
##  Broad - NS2  -0.0434 0.0173 573  -2.516  0.0325
##  NS1 - NS2    -0.0129 0.0228 573  -0.566  0.8381
## 
## Results are averaged over the levels of: Treatment, FamUnfamSpecies, Hemisphere 
## P value adjustment: tukey method for comparing a family of 3 estimates

REDUNDANCY (proportion selective)

Really there are two proportions we want to model simultaneously here to see how they are changing together: 1. the number of zebra finch songs “selective” for out of 2 and 2. the number of Bengalese finch songs “selective” for out of 2.

dprime$dselective<- with(dprime, ifelse(dprime > 0.7, "Y", ifelse(dprime < -0.7, "Y", "N")))
#summary BY UNIT to look at individual selectivity to the panel of stimuli
dtutor_unit<-dplyr::count(dprime,Unit2,Region,Type0,Treatment,Species,dselective)
#remove 'N' rows, then convert from long to wide format
dtutor_unitY<-subset(dtutor_unit,dselective!="N") #Note: this will remove the units selective to zero stimuli
dtutor_unit2<-reshape(dtutor_unitY,idvar = c("Unit2","Region","Type0","Treatment","dselective"),timevar = c("Species"), direction = "wide")
#merge with dprime_wn to pull back the units which were selective to zero stimuli
#read in dprime_wn df

dtutor_unit3<-merge(dtutor_unit2,dprime_wn,by=c("Unit2","Region","Type0","Treatment"),all.y=TRUE)
#fill in NAs with 0
dtutor_unit3$n.ZEBI[is.na(dtutor_unit3$n.ZEBI)]<- 0
dtutor_unit3$n.BEFI[is.na(dtutor_unit3$n.BEFI)]<- 0
#combine nZEBI and nBEFI columns
dtutor_unit3<-unite(dtutor_unit3,Combination.Z_B,n.ZEBI,n.BEFI,sep = "_",remove=FALSE)
#remove BEFI units
dtutor_unit3_zebi<-subset(dtutor_unit3,Treatment!="BEFI")
#Make "normal" treatment the reference level
dtutor_unit3_zebi$Treatment<-relevel(as.factor(dtutor_unit3_zebi$Treatment),ref=2)


#count number of units in each treatment group with each combination of selectivity for ZEBI/BEFI songs
dunitcount<-dplyr::count(dtutor_unit3,Region,Treatment,n.ZEBI,n.BEFI) #Could also choose to group by unit type?
#create column of proportions rather than counts 
counts<-as.data.frame(dunitcount %>% group_by(Region,Treatment) %>% summarise(sum = sum(n))) #get sum # of units for each region/treatment combination to use in calculation
## `summarise()` has grouped output by 'Region'. You can override using the
## `.groups` argument.
# add it as a new column to the df
dunitcount2<-merge(dunitcount,counts,by=c("Region","Treatment"),all.x=TRUE)
#calculate the proportion of units with that combination of response to ZEBI/BEFI songs
dunitcount2$proportion<-dunitcount2$n/dunitcount2$sum
#merge nZEBI and nBEFI columns for plotting
dunitcount2<-unite(dunitcount2,Combination.Z_B,n.ZEBI,n.BEFI,sep = "_",remove=FALSE)
#remove BEFI units again
dunitcount2_zebi<-subset(dunitcount2,Treatment!="BEFI")
#Make "normal" treatment the reference level
dunitcount2_zebi$Treatment<-relevel(as.factor(dunitcount2_zebi$Treatment),ref=2)

#plot
#change order of treatments
neworder <- c("normal","xfostered","Isolate")
dunitcount2_zebi <- arrange(transform(dunitcount2_zebi,Treatment=factor(Treatment,levels=neworder)),Treatment)
ggplot(dunitcount2_zebi,aes(x=Combination.Z_B,y=proportion,fill=Treatment))+facet_wrap(~Region)+
  geom_bar(position="dodge",stat="identity")+theme_bw()+xlab("#ZEBI_#BEFI")+ylab("Proportion")+theme(axis.text.y=element_text(size=14),axis.text.x=element_text(size=11),axis.title=element_text(size="14"))+theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())

CDF analysis

#cdf plot
ggplot(dtutor_unit3_zebi, aes(x=Combination.Z_B, group =Treatment,color=Treatment)) + stat_ecdf()+facet_wrap(~Region)

#change Combination.Z_B to a numeric variable
dtutor_unit3_zebi$combnum<-with(dtutor_unit3_zebi,ifelse(Combination.Z_B == "0_0",1,
                                ifelse(Combination.Z_B == "0_1",2, ifelse(Combination.Z_B == "0_2",3,
                                ifelse(Combination.Z_B == "1_0",4,ifelse(Combination.Z_B == "1_1",5,
                                ifelse(Combination.Z_B == "1_2",6,ifelse(Combination.Z_B == "2_0",7,
                                ifelse(Combination.Z_B == "2_1",8,9)))))))))

#levene test
levene.redun.aov<-aov(combnum~Treatment*Region,dtutor_unit3_zebi)
summary(levene.redun.aov)
##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## Treatment          2   26.3   13.15   2.431   0.0896 .  
## Region             1    0.4    0.37   0.069   0.7927    
## Treatment:Region   2  125.7   62.84  11.617 1.35e-05 ***
## Residuals        317 1714.9    5.41                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(levene.redun.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = combnum ~ Treatment * Region, data = dtutor_unit3_zebi)
## 
## $Treatment
##                         diff        lwr       upr     p adj
## Isolate-normal    -0.6560606 -1.5208388 0.2087175 0.1757675
## xfostered-normal  -0.5544174 -1.2320195 0.1231847 0.1328549
## xfostered-Isolate  0.1016432 -0.7416714 0.9449578 0.9565743
## 
## $Region
##               diff        lwr       upr     p adj
## NCM-FL -0.06793711 -0.5789654 0.4430911 0.7938305
## 
## $`Treatment:Region`
##                                  diff        lwr        upr     p adj
## Isolate:FL-normal:FL        0.7020517 -0.6850745  2.0891780 0.6955401
## xfostered:FL-normal:FL      0.5684485 -0.5821794  1.7190764 0.7170081
## normal:NCM-normal:FL        1.4915254  0.2786428  2.7044080 0.0063867
## Isolate:NCM-normal:FL      -0.9175655 -2.5834815  0.7483505 0.6128812
## xfostered:NCM-normal:FL    -0.2272246 -1.4308310  0.9763818 0.9944093
## xfostered:FL-Isolate:FL    -0.1336032 -1.4528858  1.1856793 0.9997211
## normal:NCM-Isolate:FL       0.7894737 -0.5844427  2.1633900 0.5676080
## Isolate:NCM-Isolate:FL     -1.6196172 -3.4061888  0.1669543 0.1004068
## xfostered:NCM-Isolate:FL   -0.9292763 -2.2950107  0.4364580 0.3732215
## normal:NCM-xfostered:FL     0.9230769 -0.2115911  2.0577449 0.1841589
## Isolate:NCM-xfostered:FL   -1.4860140 -3.0958784  0.1238504 0.0893233
## xfostered:NCM-xfostered:FL -0.7956731 -1.9204200  0.3290739 0.3285733
## Isolate:NCM-normal:NCM     -2.4090909 -4.0640238 -0.7541580 0.0005499
## xfostered:NCM-normal:NCM   -1.7187500 -2.9071082 -0.5303918 0.0006136
## xfostered:NCM-Isolate:NCM   0.6903409 -0.9578057  2.3384875 0.8362249

BEHAVIOR

The sample size here is low per treatment (N = 5, 5, and 3), so I will use a non-parametric test.

Wilcoxon-signed rank tests for each treatment

#Normal birds
clutchcdfg_normal<-subset(clutchcdfg,Treatment=="Normal")
clutchcdfg_normalwide<-reshape(clutchcdfg_normal, idvar = c("ID","Clutch","Treatment"), timevar = "Species", direction = "wide")
wilcox.test(clutchcdfg_normalwide$Standstim.BEFI,clutchcdfg_normalwide$Standstim.ZEBI,paired=TRUE)
## Warning in wilcox.test.default(clutchcdfg_normalwide$Standstim.BEFI,
## clutchcdfg_normalwide$Standstim.ZEBI, : cannot compute exact p-value with ties
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  clutchcdfg_normalwide$Standstim.BEFI and clutchcdfg_normalwide$Standstim.ZEBI
## V = 3, p-value = 0.2785
## alternative hypothesis: true location shift is not equal to 0
#Isolate birds
clutchcdfg_isolate<-subset(clutchcdfg,Treatment=="Isolate")
clutchcdfg_isolatewide<-reshape(clutchcdfg_isolate, idvar = c("ID","Clutch","Treatment"), timevar = "Species", direction = "wide")
wilcox.test(clutchcdfg_isolatewide$Standstim.BEFI,clutchcdfg_isolatewide$Standstim.ZEBI,paired=TRUE)
## 
##  Wilcoxon signed rank exact test
## 
## data:  clutchcdfg_isolatewide$Standstim.BEFI and clutchcdfg_isolatewide$Standstim.ZEBI
## V = 5, p-value = 0.5
## alternative hypothesis: true location shift is not equal to 0
#Xfostered birds
clutchcdfg_xfostered<-subset(clutchcdfg,Treatment=="Xfostered")
clutchcdfg_xfosteredwide<-reshape(clutchcdfg_xfostered, idvar = c("ID","Clutch","Treatment"), timevar = "Species", direction = "wide")
wilcox.test(clutchcdfg_xfosteredwide$Standstim.BEFI,clutchcdfg_xfosteredwide$Standstim.ZEBI,paired=TRUE)
## 
##  Wilcoxon signed rank exact test
## 
## data:  clutchcdfg_xfosteredwide$Standstim.BEFI and clutchcdfg_xfosteredwide$Standstim.ZEBI
## V = 12, p-value = 0.3125
## alternative hypothesis: true location shift is not equal to 0

We can’t detect a differential response to ZEBI and BEFI songs in any treatment group, which is not surprising given the small sample sizes. We can still discuss the trends in the means? Try plotting means along with the boxplots?

Check for a correlation between ephys data and behavioral data.

## WITH ZSCORES
#Average zscores across a bird (only use NCM units and only use unfamiliar zebra finch stimuli)
firezals_sum_zebiunfam<-subset(firezals_sum_zebi,FamUnfamSpecies=="Unfamiliar_ZEBI")
firezals_sum_zebiunfam_NCM<-subset(firezals_sum_zebiunfam,Region!="FL")
firezals_sum_zebiunfam_NCM_bird<-aggregate(Z_score ~ ID.x + Species, data = firezals_sum_zebiunfam_NCM, mean) 
alldata_zscore<-merge(firezals_sum_zebiunfam_NCM_bird,clutchcdfg,by.x=c("ID.x","Species"),by.y = c("ID","Species"))
cor.test(alldata_zscore$Z_score, alldata_zscore$Standstim, method = 'pearson') #0.08 --> not strong
## 
##  Pearson's product-moment correlation
## 
## data:  alldata_zscore$Z_score and alldata_zscore$Standstim
## t = 0.2581, df = 10, p-value = 0.8016
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.5166746  0.6260236
## sample estimates:
##        cor 
## 0.08134852
ggplot(alldata_zscore,aes(x=Z_score,y=Standstim,color=Treatment))+geom_point()+geom_smooth(method="lm")
## `geom_smooth()` using formula = 'y ~ x'

#just normal birds
alldata_zscore_normal<-subset(alldata_zscore,Treatment=="Normal")
cor.test(alldata_zscore_normal$Z_score, alldata_zscore_normal$Standstim, method = 'pearson') #0.86 --> strong positive correlation
## 
##  Pearson's product-moment correlation
## 
## data:  alldata_zscore_normal$Z_score and alldata_zscore_normal$Standstim
## t = 2.3502, df = 2, p-value = 0.1432
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.5906466  0.9969448
## sample estimates:
##       cor 
## 0.8568324
## WITH DPRIME
#Average dprime across a bird (only use NCM units and only use unfamiliar zebra finch stimuli)
dprime_zebiunfam<-subset(dprime_zebi,FamUnfamSpecies=="Unfamiliar_ZEBI")
dprime_zebiunfam_NCM<-subset(dprime_zebiunfam,Region!="FL")
dprime_zebiunfam_NCM_bird<-aggregate(dprime ~ ID.x + Species, data = dprime_zebiunfam_NCM, mean) 
alldata_dprime<-merge(dprime_zebiunfam_NCM_bird,clutchcdfg,by.x=c("ID.x","Species"),by.y = c("ID","Species"))
cor.test(alldata_dprime$dprime, alldata_dprime$Standstim, method = 'pearson') # 0.21
## 
##  Pearson's product-moment correlation
## 
## data:  alldata_dprime$dprime and alldata_dprime$Standstim
## t = 0.66269, df = 10, p-value = 0.5225
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.4179986  0.6969671
## sample estimates:
##       cor 
## 0.2051059
ggplot(alldata_dprime,aes(x=dprime,y=Standstim,color=Treatment))+geom_point()+geom_smooth(method="lm",se=F)
## `geom_smooth()` using formula = 'y ~ x'

#just normal treatment birds
alldata_dprime_normal<-subset(alldata_dprime,Treatment=="Normal")
cor.test(alldata_dprime_normal$dprime, alldata_dprime_normal$Standstim, method = 'pearson') # 0.99
## 
##  Pearson's product-moment correlation
## 
## data:  alldata_dprime_normal$dprime and alldata_dprime_normal$Standstim
## t = 13.648, df = 2, p-value = 0.005326
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.7627922 0.9998940
## sample estimates:
##       cor 
## 0.9946741

#REGION CORRELATION BASED ON RESPONSE STRENGTH DURING STIMULI

##Correlation of simultaneous firing rates in FL and NCM. 
#Use frates_wide2 df (already non-auditory units excluded). First renumber Presentation column to count by stimulus, not through the whole trial
frates_wide2 <- frates_wide2%>% group_by(Unit2,Stimulus) %>% mutate(Presentation=row_number())
#Create new column to represent change in firing rate during stimulus vs before stimulus
#(stim_fr-base_fr)/(mean base_fr for that unit-stimulus combo)
#First calculate mean base_fr and merge it with the df, then calculate change
#stimbasemean<-as.data.frame(frates_wide2 %>% group_by(Unit2,Stimulus) %>% summarise(meanbase_fr=mean(base_fr)))
#frates_wide3<-merge(frates_wide2,stimbasemean,by=c("Unit2","Stimulus"),all.x=TRUE)
frates_wide3$RS<-frates_wide3$stim_fr-frates_wide3$base_fr
#Calculate average FRchange for each region/trial/stimulus/presentation. Will calculate a mean if multiple units found in the same region in the same trial
frates_RS<-as.data.frame(frates_wide3 %>% group_by(ID,Region,Trial,Stimulus,Presentation) %>% summarise(RS=mean(RS)))
## `summarise()` has grouped output by 'ID', 'Region', 'Trial', 'Stimulus'. You
## can override using the `.groups` argument.
#Add summary df to get treatment info
frates_wide4<-merge(frates_RS,summary[,c("ID","Treatment")],by=c("ID"),all.x=TRUE,all.y=FALSE)
frates_wide4 <- frates_wide4 %>% distinct() #removes duplicate rows created from last line of code
#Add stimIDs to get FamUnfam info
stiminfo<-merge(stimframe,stimIDs,by=c("StimSet"),all.y=TRUE)
frates_wide4$Stimulus<-gsub("[?]","",frates_wide4$Stimulus)
frates_wide4<-merge(frates_wide4,stiminfo,by.x=c("ID","Region","Trial","Stimulus"),by.y=c("ID.x","Region","Trial","StimNumber"),all.x=TRUE)
#convert to wide format so that FL and NCM from same presentation are in the same row
frates_wide4_FL<-subset(frates_wide4,Region=="FL")
frates_wide4_NCM<-subset(frates_wide4,Region=="NCM")
frates_wide4_wide<-merge(frates_wide4_FL,frates_wide4_NCM,by=c("ID","Trial","Stimulus","Presentation","Treatment"))
#the above line should filter out trials with only units from one region
#merge FamUnfam and Species columns
frates_wide4_wide<-unite(frates_wide4_wide,FamUnfamSpecies,FamUnfam.y,Species.y, sep = "_",remove=FALSE)
#calculate distance from 1:1 line
res<-resid(lm(frates_wide4_wide$RS.y-frates_wide4_wide$RS.x ~ 0))
frates_wide4_wide<-cbind(frates_wide4_wide,res)
#plots
ggplot(frates_wide4_wide,aes(x=RS.x,y=RS.y,color=Treatment))+geom_point(alpha=0.3)+geom_abline(slope=1,intercept=0,lty=2)+labs(x="Field L RS", y="NCM RS")+geom_smooth(method="lm")
## `geom_smooth()` using formula = 'y ~ x'

ggplot(frates_wide4_wide,aes(x=Treatment,y=res,color=Treatment))+geom_boxplot()+labs(x="", y="Distance from 1:1 line")

kruskal.test(res~Treatment,data=frates_wide4_wide) 
## 
##  Kruskal-Wallis rank sum test
## 
## data:  res by Treatment
## Kruskal-Wallis chi-squared = 266.6, df = 2, p-value < 2.2e-16
library(dunn.test)
dunn.test(frates_wide4_wide$res,frates_wide4_wide$Treatment,method = "Bonferroni")
##   Kruskal-Wallis rank sum test
## 
## data: x and group
## Kruskal-Wallis chi-squared = 266.6024, df = 2, p-value = 0
## 
## 
##                            Comparison of x by group                            
##                                  (Bonferroni)                                  
## Col Mean-|
## Row Mean |    Isolate     normal
## ---------+----------------------
##   normal |  -4.552900
##          |    0.0000*
##          |
## xfostere |   6.512885   16.29999
##          |    0.0000*    0.0000*
## 
## alpha = 0.05
## Reject Ho if p <= alpha/2
frates_wide4_wide %>% 
  group_by(Treatment) %>% 
  summarize(mean = mean(res))
## # A tibble: 3 × 2
##   Treatment   mean
##   <chr>      <dbl>
## 1 Isolate   -1.36 
## 2 normal    -0.569
## 3 xfostered -3.06
model<-glmmTMB(res~Treatment+FamUnfamSpecies+(1|ID),data=frates_wide4_wide)
#model1<-glmmTMB(res~Treatment*FamUnfamSpecies+(1|ID),data=frates_wide4_wide) #does not converge
model2<-glmmTMB(res~Treatment+FamUnfamSpecies+(1|ID),data=frates_wide4_wide,family=tweedie)
#model3<-glmmTMB(res~Treatment*FamUnfamSpecies+(1|ID),data=frates_wide4_wide,family=tweedie) #does not converge
AICtab(model,model2 #model 2 has much lower AIC, but diagnostics are much worse

#Diagnostics
simres <- simulateResiduals(model)
plot(simres) 
#testDispersion(simres) 
#testZeroInflation(simres) 
testOutliers(simres,type='bootstrap') #outliers significant

#removing outliers
frates_wide4_wide_outliersremoved<-cbind(frates_wide4_wide,simres$scaledResiduals) #scaled residuals based on "model"
colnames(frates_wide4_wide_outliersremoved)[24]<-'scaledResiduals' #might need to be 22?
frates_wide4_wide_outliersremoved<-subset(frates_wide4_wide_outliersremoved,scaledResiduals>0 & scaledResiduals<1)
model_nooutliers<-glmmTMB(res~Treatment+FamUnfamSpecies+(1|ID),data=frates_wide4_wide_outliersremoved)
AICtab(model,model2,model_nooutliers)
simres2 <- simulateResiduals(model_nooutliers)
plot(simres2)
testOutliers(simres2,type='bootstrap') #outliers significant

#Inference
emmeans(model_nooutliers,pairwise~Treatment)